File tree 1 file changed +13
-6
lines changed
1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change
1
+ # syntax = docker/dockerfile:1.4
2
+
1
3
# build image
2
4
FROM golang:alpine as build
3
5
WORKDIR /build
6
+
4
7
RUN apk add --no-cache make
5
8
COPY go.sum go.mod Makefile /build/
6
- RUN make go-fetch
9
+ RUN \
10
+ --mount=type=cache,target=/root/.cache \
11
+ --mount=type=cache,target=/go \
12
+ make go-fetch
13
+
7
14
COPY . /build/
8
- RUN make
15
+ RUN \
16
+ --mount=type=cache,target=/root/.cache \
17
+ --mount=type=cache,target=/go \
18
+ make
9
19
10
20
# runtime image
11
21
FROM alpine:3.18
12
22
RUN apk add --no-cache ca-certificates
13
- # set up nsswitch.conf for Go's "netgo" implementation
14
- # - https://github.com/docker-library/golang/blob/1eb096131592bcbc90aa3b97471811c798a93573/1.14/alpine3.12/Dockerfile#L9
15
- RUN if [ ! -e /etc/nsswitch.conf ];then echo 'hosts: files dns' > /etc/nsswitch.conf;fi
16
23
COPY --from=build /build/vault-unseal /usr/local/bin/vault-unseal
17
24
18
25
# runtime params
19
26
WORKDIR /
20
27
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
21
28
ENV LOG_JSON=true
22
- CMD ["vault-unseal" ]
29
+ CMD ["/usr/local/bin/ vault-unseal" ]
You can’t perform that action at this time.
0 commit comments