-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (41 loc) · 1.61 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
ARG VAULT_TAG=1.13.3
FROM vault:${VAULT_TAG} AS base
COPY ./config/vault.hcl /hc-vault/vault.hcl
# Build the image for amd64 architecture
FROM base AS amd64
RUN echo "Building for amd64 architecture"
RUN uname -m
RUN vault version
LABEL org.label-schema.architecture="amd64"
LABEL org.label-schema.version=${VAULT_TAG}
LABEL org.label-schema.description="Basic Vault image with sample configuration (amd64)"
COPY README.md /
# Build the image for arm64 architecture
FROM base AS arm64
ARG OPENSSL_VERSION
RUN echo "Building for arm64 architecture"
RUN uname -m
RUN vault version
LABEL org.label-schema.architecture="arm64"
LABEL org.label-schema.version=${VAULT_TAG}
LABEL org.label-schema.description="Basic Vault image with sample configuration (arm64)"
COPY README.md /
# Set multi-architecture labels
LABEL org.label-schema.architecture="multi-platform"
LABEL org.label-schema.version=${VAULT_TAG}
LABEL org.label-schema.description="Basic Vault image with sample configuration (multi-platform)"
# Create a manifest list to include both images
FROM scratch AS manifest
COPY --from=amd64 / /
COPY --from=arm64 / /
LABEL org.label-schema.architecture="multi-platform"
LABEL org.label-schema.version=${VAULT_TAG}
LABEL org.label-schema.description="Basic Vault image with sample configuration (multi-platform)"
CMD [ "cat", "/README.md" ]
# Use the manifest command to create a single image that can run on multiple architectures
FROM manifest AS final
ENV VAULT_ADDR=http://127.0.0.1:8200
ENV VAULT_API_ADDR=http://127.0.0.1:8200
ENV VAULT_SKIP_VERIFY=true
EXPOSE 8200
CMD [ "vault" ]