Verified Commit 5d4ff077 authored by Janne Koschinski's avatar Janne Koschinski
Browse files

Automate container builds

parent d6c58df4
Pipeline #620 passed with stage
in 5 minutes and 46 seconds
build:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}
FROM openjdk:8-jdk as builder
# define arguments for versions to be used for platform and build tools
ARG PLATFORM
ARG BUILD_TOOLS
ARG PLATFORM=30
ARG BUILD_TOOLS=30.0.3
RUN apt-get --quiet update --yes && \
apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
......
IMAGE := k8r.eu/justjanne/$(shell basename $(shell git remote get-url origin) .git)
PLATFORM := 30
BUILD_TOOLS := 30.0.3
TAGS := $(PLATFORM)-$(BUILD_TOOLS)
.PHONY: build
build:
docker build --pull -t $(IMAGE):$(TAGS) . \
--build-arg PLATFORM=$(PLATFORM) \
--build-arg BUILD_TOOLS=$(BUILD_TOOLS)
docker tag $(IMAGE):$(TAGS) $(IMAGE):latest
@echo Successfully tagged $(IMAGE):$(TAGS) as latest
.PHONY: push
push: build
docker push $(IMAGE):$(TAGS)
docker push $(IMAGE):latest
@echo Successfully pushed $(IMAGE):$(TAGS) as latest
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment