mirror of
https://github.com/project-zot/zot.git
synced 2025-01-06 22:40:28 -05:00
ci/cd: include tag name in release docker builds
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
This commit is contained in:
parent
50a0831f1b
commit
fc4a34d43a
7 changed files with 21 additions and 8 deletions
12
.github/workflows/ci-cd.yml
vendored
12
.github/workflows/ci-cd.yml
vendored
|
@ -81,6 +81,8 @@ jobs:
|
|||
- name: Build container image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
build-args: |
|
||||
COMMIT=${{ github.event.release.tag_name }}-${{ github.sha }}
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }}
|
||||
|
@ -88,6 +90,8 @@ jobs:
|
|||
- name: Build minimal container image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
build-args: |
|
||||
COMMIT=${{ github.event.release.tag_name }}-${{ github.sha }}
|
||||
push: true
|
||||
file: Dockerfile-minimal
|
||||
tags: |
|
||||
|
@ -96,7 +100,9 @@ jobs:
|
|||
- name: Build container image (arm64)
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
build-args: ARCH=arm64
|
||||
build-args: |
|
||||
COMMIT=${{ github.event.release.tag_name }}-${{ github.sha }}
|
||||
ARCH=arm64
|
||||
push: true
|
||||
file: Dockerfile-arch
|
||||
tags: |
|
||||
|
@ -105,7 +111,9 @@ jobs:
|
|||
- name: Build minimal container image (arm64)
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
build-args: ARCH=arm64
|
||||
build-args: |
|
||||
COMMIT=${{ github.event.release.tag_name }}-${{ github.sha }}
|
||||
ARCH=arm64
|
||||
push: true
|
||||
file: Dockerfile-arch-minimal
|
||||
tags: |
|
||||
|
|
|
@ -2,10 +2,11 @@
|
|||
# Stage 1: Install certs, build binary, create default config file
|
||||
# ---
|
||||
FROM docker.io/golang:1.16 AS builder
|
||||
ARG COMMIT
|
||||
RUN mkdir -p /go/src/github.com/project-zot/zot
|
||||
WORKDIR /go/src/github.com/project-zot/zot
|
||||
COPY . .
|
||||
RUN make clean binary
|
||||
RUN make COMMIT=$COMMIT clean binary
|
||||
RUN echo '{\n\
|
||||
"storage": {\n\
|
||||
"rootDirectory": "/var/lib/registry"\n\
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
# Stage 1: Install certs, build binary, create default config file
|
||||
# ---
|
||||
FROM docker.io/golang:1.16 AS builder
|
||||
ARG COMMIT
|
||||
ARG ARCH
|
||||
RUN mkdir -p /go/src/github.com/project-zot/zot
|
||||
WORKDIR /go/src/github.com/project-zot/zot
|
||||
COPY . .
|
||||
RUN make ARCH=$ARCH clean binary
|
||||
RUN make COMMIT=$COMMIT ARCH=$ARCH clean binary
|
||||
RUN echo '{\n\
|
||||
"storage": {\n\
|
||||
"rootDirectory": "/var/lib/registry"\n\
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
# Stage 1: Install certs, build binary, create default config file
|
||||
# ---
|
||||
FROM docker.io/golang:1.16 AS builder
|
||||
ARG COMMIT
|
||||
ARG ARCH
|
||||
RUN mkdir -p /go/src/github.com/project-zot/zot
|
||||
WORKDIR /go/src/github.com/project-zot/zot
|
||||
COPY . .
|
||||
RUN make ARCH=$ARCH clean binary-minimal
|
||||
RUN make COMMIT=$COMMIT ARCH=$ARCH clean binary-minimal
|
||||
RUN echo '{\n\
|
||||
"storage": {\n\
|
||||
"rootDirectory": "/var/lib/registry"\n\
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
# Stage 1: Install certs, build binary, create default config file
|
||||
# ---
|
||||
FROM docker.io/golang:1.16-alpine AS builder
|
||||
ARG COMMIT
|
||||
RUN apk --update add git make ca-certificates
|
||||
RUN mkdir -p /go/src/github.com/project-zot/zot
|
||||
WORKDIR /go/src/github.com/project-zot/zot
|
||||
COPY . .
|
||||
RUN make clean binary
|
||||
RUN make COMMIT=$COMMIT clean binary
|
||||
RUN echo -e '# Default config file for zot server\n\
|
||||
http:\n\
|
||||
address: 0.0.0.0\n\
|
||||
|
|
|
@ -2,10 +2,11 @@
|
|||
# Stage 1: Install certs, build binary, create default config file
|
||||
# ---
|
||||
FROM docker.io/golang:1.16 AS builder
|
||||
ARG COMMIT
|
||||
RUN mkdir -p /go/src/github.com/project-zot/zot
|
||||
WORKDIR /go/src/github.com/project-zot/zot
|
||||
COPY . .
|
||||
RUN make clean binary-minimal
|
||||
RUN make COMMIT=$COMMIT clean binary-minimal
|
||||
RUN echo '{\n\
|
||||
"storage": {\n\
|
||||
"rootDirectory": "/var/lib/registry"\n\
|
||||
|
|
2
Makefile
2
Makefile
|
@ -2,7 +2,7 @@ export GO111MODULE=on
|
|||
TOP_LEVEL=$(shell git rev-parse --show-toplevel)
|
||||
COMMIT_HASH=$(shell git describe --always --tags --long)
|
||||
GO_VERSION=$(shell go version | awk '{print $$3}')
|
||||
COMMIT=$(if $(shell git status --porcelain --untracked-files=no),$(COMMIT_HASH)-dirty,$(COMMIT_HASH))
|
||||
COMMIT ?= $(if $(shell git status --porcelain --untracked-files=no),$(COMMIT_HASH)-dirty,$(COMMIT_HASH))
|
||||
CONTAINER_RUNTIME := $(shell command -v podman 2> /dev/null || echo docker)
|
||||
PATH := bin:$(PATH)
|
||||
TMPDIR := $(shell mktemp -d)
|
||||
|
|
Loading…
Reference in a new issue