Skip to content

Commit

Permalink
fix version identification for Dockerhub (with Docker args)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmasek committed Feb 15, 2025
1 parent 3516818 commit 943f064
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*.md
*.log
*.txt
# .git
.git
.github
Dockerfile
tmp
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ RUN --mount=type=cache,target=/root/go/pkg/mod \
go mod download && go mod verify

COPY . .
ARG GIT_REF
ARG GIT_SHA
RUN echo "Specified version ${GIT_REF} ${GIT_SHA}"
RUN --mount=type=cache,target=/root/.cache/go-build \
go build -o /app/beacon \
-ldflags="-X 'conf.GitRef=${GIT_REF}' -X 'conf.GitSha=${GIT_SHA}'"
-ldflags "-X 'github.com/davidmasek/beacon/conf.GitRef=${GIT_REF}' -X 'github.com/davidmasek/beacon/conf.GitSha=${GIT_SHA}'"

# Stage 2: Main
# -----------------------------------
Expand Down
4 changes: 3 additions & 1 deletion test_docker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3

import os
import subprocess
import time
import requests
Expand All @@ -18,6 +18,8 @@ def run_compose_cmd(*args):
# todo: refactor
def main():
try:
# print extra info about build
os.environ.setdefault("BUILDKIT_PROGRESS", "plain")
print("Starting Beacon test.")
print("---------------------")
run_compose_cmd("down")
Expand Down

0 comments on commit 943f064

Please sign in to comment.