From cc155f33796248d941858bc8647898d1e6d115d3 Mon Sep 17 00:00:00 2001 From: Ruslan Aliev Date: Tue, 14 Sep 2021 15:12:26 -0500 Subject: [PATCH] Add golang images Allows to avoid docker pull limit issue. Signed-off-by: Ruslan Aliev Change-Id: Ie69b0fa6b51a7d91f17304535759e81c0d2e81c0 --- golang/Makefile | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 golang/Makefile diff --git a/golang/Makefile b/golang/Makefile new file mode 100644 index 0000000..c06bfb3 --- /dev/null +++ b/golang/Makefile @@ -0,0 +1,45 @@ + +# Copyright 2018 AT&T Intellectual Property. All other rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +SHELL := /bin/bash +PUSH_IMAGE ?= false +IMAGE_NAME ?= golang +DOCKER_REGISTRY ?= quay.io +IMAGE_PREFIX ?= airshipit +IMAGE_TAGS := 1.16.8-buster 1.16.8-alpine +IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}: +PROXY ?= http://proxy.foo.com:8000 +NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local +USE_PROXY ?= false +all: check-docker images +check-docker: + @if [ -z $$(which docker) ]; then \ + echo "Missing \`docker\` client which is required for development"; \ + exit 2; \ + fi +images: check-docker + for i in $(IMAGE_TAGS); do \ + docker pull amd64/golang:$$i; \ + docker tag amd64/golang:$$i $(IMAGE)$$i; \ + if [ $(PUSH_IMAGE) == "true" ] ; then \ + docker push $(IMAGE)$$i; \ + fi \ + done +clean: + for i in $(IMAGE_TAGS); do \ + docker rmi $(IMAGE)$$i; \ + done +tests: + echo "Dummy Test to Pass gates" +.PHONY: all check-docker images clean tests