vault-wrap: Починяем сборку образа

This commit is contained in:
svkalinin 2024-07-10 13:24:42 +03:00
parent e1a9944082
commit 4222c468c5

View File

@ -1,31 +1,23 @@
FROM golang:alpine AS build FROM golang:1.22 AS build
RUN apk --no-cache add gcc g++ make git
WORKDIR /go/src/app WORKDIR /app
COPY . . COPY . .
RUN go get ./...
RUN GOOS=linux go build -ldflags="-s -w" -o ./bin/vault-wrap ./vault.go RUN GOOS=linux go build -ldflags="-s -w" -o ./bin/vault-wrap ./vault.go
FROM alpine:3.20 FROM alpine:3.20
RUN apk add tzdata
#RUN apk --no-cache add ca-certificates WORKDIR /app
RUN mkdir -p /usr/local/share/vault-wrap && mkdir -p /var/log/vault-wrap RUN mkdir -p /usr/local/share/vault-wrap && mkdir -p /var/log/vault-wrap
WORKDIR /usr/bin WORKDIR /usr/bin
COPY --from=build /go/src/app/bin /go/bin COPY --from=build /app/bin /go/bin
# COPY cronjobs /etc/crontabs/root
COPY entrypoint.sh . COPY entrypoint.sh .
# COPY cronjobs /etc/crontabs/root
# start crond with log level 8 in foreground, output to stderr
# CMD ["crond", "-f", "-d", "8"]
ENTRYPOINT ["/bin/sh", "./entrypoint.sh"] ENTRYPOINT ["/bin/sh", "./entrypoint.sh"]