Skip to content

Commit

Permalink
Merge pull request #12 from i-am-yuvi/dockerfile-changes
Browse files Browse the repository at this point in the history
dockerfile updated to better with security
  • Loading branch information
msvticket authored Mar 2, 2024
2 parents 394f184 + aaf7ce0 commit c3d824a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ FROM cgr.dev/chainguard/wolfi-base:latest
COPY --from=build /jx-cdevents-adapter /jx-cdevents-adapter
EXPOSE 80

# Add a new user
RUN adduser -D myuser

# Change the ownership of the binary to the new user
RUN chown myuser:myuser /jx-cdevents-adapter

# Run the binary as the new user
USER myuser

# required for external tools to detect this as a go binary
ENV GOTRACEBACK=all

Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ require (
github.com/go-chi/chi/v5 v5.0.8
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
)

1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 comments on commit c3d824a

Please sign in to comment.