Add golang images

Allows to avoid docker pull limit issue.

Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Change-Id: Ie69b0fa6b51a7d91f17304535759e81c0d2e81c0
This commit is contained in:
Ruslan Aliev 2021-09-14 15:12:26 -05:00
parent ab1d8ac1c4
commit cc155f3379
1 changed files with 45 additions and 0 deletions

45
golang/Makefile Normal file
View File

@ -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