Skip to content

Commit

Permalink
try a docker arg
Browse files Browse the repository at this point in the history
  • Loading branch information
ianrose14 committed Nov 10, 2023
1 parent e59cf5d commit 88a4761
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ jobs:
- name: Test
run: go test ./...

- name: Setup
run: mkdir -p bin/linux && cp bin/webapp bin/linux_amd64/webapp

- name: Get shortsha
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
Expand All @@ -38,3 +35,4 @@ jobs:
project_id: ian-rose
image_name: us-central1-docker.pkg.dev/ian-rose/docker-1/webapp
image_tag: latest,${{ steps.vars.outputs.sha_short }}
build_args: BIN=bin/webapp
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM debian:bullseye-slim
ARG BIN
WORKDIR /root/
RUN apt-get update
RUN apt-get install -y ca-certificates

# make cgo happy, see https://github.com/mattn/go-sqlite3/issues/855#issuecomment-1496136603
RUN apt-get install -y build-essential
COPY bin/linux_amd64/webapp /root
COPY $BIN /root
2 changes: 1 addition & 1 deletion scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -e

make webapp-linux

docker buildx build --platform linux/amd64 -t us-central1-docker.pkg.dev/ian-rose/docker-1/webapp:latest .
docker buildx build --platform linux/amd64 --build-arg BIN=bin/linux_amd64/webapp -t us-central1-docker.pkg.dev/ian-rose/docker-1/webapp:latest .
#docker build -t us-central1-docker.pkg.dev/ian-rose/docker-1/webapp:latest .
docker push us-central1-docker.pkg.dev/ian-rose/docker-1/webapp:latest

Expand Down

0 comments on commit 88a4761

Please sign in to comment.