Skip to content

Commit

Permalink
fix: set path via workdir
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeMac committed Nov 20, 2024
1 parent 3cc1cb8 commit 343219e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ ADD . .

WORKDIR cmd/app

Check warning on line 5 in cmd/app/Dockerfile

View workflow job for this annotation

GitHub Actions / app

Relative workdir without an absolute workdir declared within the build can have unexpected results if the base image changes

WorkdirRelativePath: Relative workdir "cmd/app" can have unexpected results if the base image changes More info: https://docs.docker.com/go/dockerfile/rule/workdir-relative-path/

RUN sh -c 'go build -ldflags "-X main.SHA=$(git rev-parse HEAD)" -o /bin/app ./cmd/app/.'
RUN sh -c 'go build -ldflags "-X main.SHA=$(git rev-parse HEAD)" -o /bin/app .'

CMD "/bin/app"

Check warning on line 9 in cmd/app/Dockerfile

View workflow job for this annotation

GitHub Actions / app

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/
4 changes: 2 additions & 2 deletions cmd/pipeline/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM golang:1.23

ADD . .

WORKDIR cmd/app
WORKDIR cmd/pipeline

Check warning on line 5 in cmd/pipeline/Dockerfile

View workflow job for this annotation

GitHub Actions / pipeline

Relative workdir without an absolute workdir declared within the build can have unexpected results if the base image changes

WorkdirRelativePath: Relative workdir "cmd/pipeline" can have unexpected results if the base image changes More info: https://docs.docker.com/go/dockerfile/rule/workdir-relative-path/

RUN sh -c 'go build -o /bin/pipeline ./cmd/pipeline/.'
RUN sh -c 'go build -o /bin/pipeline .'

CMD "/bin/pipeline"

Check warning on line 9 in cmd/pipeline/Dockerfile

View workflow job for this annotation

GitHub Actions / pipeline

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/
6 changes: 1 addition & 5 deletions cmd/pipeline/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module get-glu/gitops-example/pipeline
go 1.23.3

require (
github.com/get-glu/glu v0.0.1-prerelease2
github.com/get-glu/glu v0.0.1-prerelease2.0.20241120131841-e88e710e168b
github.com/get-glu/glu/ui v0.0.1-prerelease2
github.com/opencontainers/image-spec v1.1.0
k8s.io/api v0.31.2
Expand Down Expand Up @@ -62,7 +62,3 @@ require (
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)

replace github.com/get-glu/glu => ../../../../flipt-io/glu

replace github.com/get-glu/glu/ui => ../../../../flipt-io/glu/ui

0 comments on commit 343219e

Please sign in to comment.