diff --git a/Dockerfile.cpuv1 b/Dockerfile.cpuv1 index 4085ac3..4d1e492 100644 --- a/Dockerfile.cpuv1 +++ b/Dockerfile.cpuv1 @@ -1,4 +1,7 @@ -FROM alpine:3.14 +FROM alpine:3.18 COPY helmize /usr/bin/helmize +RUN mkdir -p /.config /.cache && \ + chown nobody:nobody /.config /.cache + CMD ["/usr/bin/helmize"] \ No newline at end of file diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000..58d4d1b --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,15 @@ +FROM golang:1.21-alpine3.18 AS builder +WORKDIR /app +COPY go.mod go.sum ./ +RUN go mod download + +COPY . . +RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o bin/helmize + +FROM alpine:3.18 +COPY --from=builder /app/bin/helmize /usr/bin/helmize +RUN mkdir -p /.config /.cache && \ + chown nobody:nobody /.config /.cache + +USER nobody +CMD ["/usr/bin/helmize"] \ No newline at end of file diff --git a/Dockerfile.goreleaser b/Dockerfile.goreleaser index 34d6acf..31ccdf4 100644 --- a/Dockerfile.goreleaser +++ b/Dockerfile.goreleaser @@ -1,4 +1,7 @@ FROM ghcr.io/ardikabs/etc/shell COPY helmize /usr/bin/helmize -ENTRYPOINT ["/usr/bin/helmize"] \ No newline at end of file +RUN mkdir -p /.config /.cache && \ + chown nobody:nobody /.config /.cache + +CMD ["/usr/bin/helmize"] \ No newline at end of file diff --git a/pkg/helm/repo.go b/pkg/helm/repo.go index 403b4bd..00e02cf 100644 --- a/pkg/helm/repo.go +++ b/pkg/helm/repo.go @@ -90,11 +90,7 @@ func (r HelmRepo) loadFile(path string) (file *repo.File, err error) { return } - if err = file.WriteFile(path, 0644); err != nil { - return - } - - return + return file, nil } // NameAndChart returns the name and chart that should be used.