Skip to content

Commit

Permalink
Enhance dockerfile, bump release.
Browse files Browse the repository at this point in the history
  • Loading branch information
cguertin14 committed Dec 13, 2023
1 parent 9d38c9b commit bafe566
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 893 deletions.
17 changes: 2 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ ENV CGO_ENABLED=0 \
VERSION=${VERSION} \
GIT_COMMIT=${GIT_COMMIT}

RUN apk add --no-cache --update ca-certificates make git

WORKDIR /app

COPY go.* ./
Expand All @@ -30,18 +28,7 @@ RUN go build \
-ldflags "-X github.com/cguertin14/k3supdater/cmd.Version=${VERSION} -X github.com/cguertin14/k3supdater/cmd.BuildDate=${BUILD_DATE} -X github.com/cguertin14/k3supdater/cmd.GitCommit=${GIT_COMMIT}" \
-o ./k3supdater .

# Add user & group
RUN addgroup -S updater-group && \
adduser -S updater-user -G updater-group


# Step 2 - import necessary files to run program.
FROM scratch

COPY --from=builder /etc/passwd /etc/passwd
FROM gcr.io/distroless/base-debian11:nonroot
COPY --from=builder /app/k3supdater /k3supdater
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

USER updater-user

ENTRYPOINT ["/k3supdater"]
ENTRYPOINT ["/ddns"]
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require (
github.com/cguertin14/logger v1.0.6
github.com/golang/mock v1.6.0
github.com/google/go-github/v43 v43.0.0
github.com/google/go-github/v57 v57.0.0
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.18.1
golang.org/x/mod v0.14.0
Expand All @@ -16,20 +15,19 @@ require (
require (
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
Expand All @@ -42,6 +40,5 @@ require (
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit bafe566

Please sign in to comment.