mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
cicd: store git commit hash into docker image (#1931)
This commit is contained in:
parent
0c9fc2b882
commit
84de57cadc
2 changed files with 11 additions and 2 deletions
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
|
@ -70,7 +70,7 @@ jobs:
|
|||
- name: Login to Docker Hub
|
||||
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
|
||||
- name: Build Docker image
|
||||
run: docker build -t xinfinorg/xdposchain:${GITHUB_REF#refs/tags/} -f cicd/Dockerfile .
|
||||
run: docker build --build-arg GIT_COMMIT=${GITHUB_SHA} -t xinfinorg/xdposchain:${GITHUB_REF#refs/tags/} -f cicd/Dockerfile .
|
||||
- name: Push Docker image
|
||||
run: docker push xinfinorg/xdposchain:${GITHUB_REF#refs/tags/}
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ jobs:
|
|||
docker pull xinfinorg/devnet:latest
|
||||
docker tag xinfinorg/devnet:latest xinfinorg/devnet:previous
|
||||
docker rmi xinfinorg/devnet:latest
|
||||
docker build -t xinfinorg/devnet:latest -f cicd/Dockerfile .
|
||||
docker build --build-arg GIT_COMMIT=${GITHUB_SHA} -t xinfinorg/devnet:latest -f cicd/Dockerfile .
|
||||
docker tag xinfinorg/devnet:latest $image_name
|
||||
docker push $image_name
|
||||
docker push xinfinorg/devnet:latest
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
# Support setting various labels on the final image
|
||||
ARG GIT_COMMIT=""
|
||||
ENV GIT_COMMIT="$GIT_COMMIT"
|
||||
|
||||
FROM golang:1.25-alpine AS builder
|
||||
|
||||
RUN apk add make build-base linux-headers
|
||||
|
|
@ -51,3 +55,8 @@ EXPOSE 8555
|
|||
EXPOSE 30303
|
||||
|
||||
ENTRYPOINT ["bash","/work/entry.sh"]
|
||||
|
||||
# Add some metadata labels to help programmatic image consumption
|
||||
ARG GIT_COMMIT=""
|
||||
ENV GIT_COMMIT="$GIT_COMMIT"
|
||||
LABEL git_commit="$GIT_COMMIT"
|
||||
|
|
|
|||
Loading…
Reference in a new issue