Ensure that git commit is set in docker build

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar 2022-05-12 14:19:29 +02:00
parent 4a19bf16a8
commit 25710468dc
6 changed files with 11 additions and 0 deletions

View File

@ -41,6 +41,8 @@ RUN mkdir -p $DIST_DIR /dist
WORKDIR $GOPATH/src/nvidia-container-toolkit WORKDIR $GOPATH/src/nvidia-container-toolkit
COPY . . COPY . .
ARG GIT_COMMIT
ENV GIT_COMMIT ${GIT_COMMIT}
RUN make PREFIX=${DIST_DIR} cmds RUN make PREFIX=${DIST_DIR} cmds
ARG CONFIG_TOML_SUFFIX ARG CONFIG_TOML_SUFFIX

View File

@ -41,6 +41,8 @@ RUN mkdir -p $DIST_DIR /dist
WORKDIR $GOPATH/src/nvidia-container-toolkit WORKDIR $GOPATH/src/nvidia-container-toolkit
COPY . . COPY . .
ARG GIT_COMMIT
ENV GIT_COMMIT ${GIT_COMMIT}
RUN make PREFIX=${DIST_DIR} cmds RUN make PREFIX=${DIST_DIR} cmds
ARG CONFIG_TOML_SUFFIX ARG CONFIG_TOML_SUFFIX

View File

@ -48,6 +48,8 @@ RUN mkdir -p $DIST_DIR /dist
WORKDIR $GOPATH/src/nvidia-container-toolkit WORKDIR $GOPATH/src/nvidia-container-toolkit
COPY . . COPY . .
ARG GIT_COMMIT
ENV GIT_COMMIT ${GIT_COMMIT}
RUN make PREFIX=${DIST_DIR} cmds RUN make PREFIX=${DIST_DIR} cmds
ARG CONFIG_TOML_SUFFIX ARG CONFIG_TOML_SUFFIX

View File

@ -39,6 +39,8 @@ RUN mkdir -p $DIST_DIR /dist
WORKDIR $GOPATH/src/nvidia-container-toolkit WORKDIR $GOPATH/src/nvidia-container-toolkit
COPY . . COPY . .
ARG GIT_COMMIT
ENV GIT_COMMIT ${GIT_COMMIT}
RUN make PREFIX=${DIST_DIR} cmds RUN make PREFIX=${DIST_DIR} cmds
# Hook for Project Atomic's fork of Docker: https://github.com/projectatomic/docker/tree/docker-1.13.1-rhel#add-dockerhooks-exec-custom-hooks-for-prestartpoststop-containerspatch # Hook for Project Atomic's fork of Docker: https://github.com/projectatomic/docker/tree/docker-1.13.1-rhel#add-dockerhooks-exec-custom-hooks-for-prestartpoststop-containerspatch

View File

@ -46,6 +46,8 @@ RUN mkdir -p $DIST_DIR /dist
WORKDIR $GOPATH/src/nvidia-container-toolkit WORKDIR $GOPATH/src/nvidia-container-toolkit
COPY . . COPY . .
ARG GIT_COMMIT
ENV GIT_COMMIT ${GIT_COMMIT}
RUN make PREFIX=${DIST_DIR} cmds RUN make PREFIX=${DIST_DIR} cmds
ARG CONFIG_TOML_SUFFIX ARG CONFIG_TOML_SUFFIX

View File

@ -131,6 +131,7 @@ docker-build-%:
--build-arg PKG_VERS="$(LIB_VERSION)" \ --build-arg PKG_VERS="$(LIB_VERSION)" \
--build-arg PKG_REV="$(PKG_REV)" \ --build-arg PKG_REV="$(PKG_REV)" \
--build-arg CONFIG_TOML_SUFFIX="$(CONFIG_TOML_SUFFIX)" \ --build-arg CONFIG_TOML_SUFFIX="$(CONFIG_TOML_SUFFIX)" \
--build-arg GIT_COMMIT="$(GIT_COMMIT)" \
--tag $(BUILDIMAGE) \ --tag $(BUILDIMAGE) \
--file $(DOCKERFILE) . --file $(DOCKERFILE) .
$(DOCKER) run \ $(DOCKER) run \