This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
forked from bank-vaults/bank-vaults
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
49 lines (28 loc) · 1.51 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
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.2.1@sha256:8879a398dedf0aadaacfbd332b29ff2f84bc39ae6d4e9c0a1109db27ac5ba012 AS xx
FROM --platform=$BUILDPLATFORM golang:1.20.4-alpine3.16@sha256:6469405d7297f82d56195c90a3270b0806ef4bd897aa0628477d9959ab97a577 AS builder
COPY --from=xx / /
RUN apk add --update --no-cache ca-certificates make git curl clang lld
ARG TARGETPLATFORM
RUN xx-apk --update --no-cache add musl-dev gcc
RUN xx-go --wrap
WORKDIR /usr/local/src/bank-vaults
ARG GOPROXY
ENV CGO_ENABLED=1
COPY go.* ./
RUN go mod download
COPY . .
RUN go build -o /usr/local/bin/bank-vaults ./cmd/bank-vaults/
RUN xx-verify /usr/local/bin/bank-vaults
RUN go build -o /usr/local/bin/template ./cmd/template/
RUN xx-verify /usr/local/bin/template
FROM alpine:3.18.2@sha256:82d1e9d7ed48a7523bdebc18cf6290bdb97b82302a8a9c27d4fe885949ea94d1
RUN apk add --update --no-cache ca-certificates tzdata
# RUN apk add --no-cache ccid opensc pcsc-lite-libs softhsm
# Initializing SoftHSM to be able to create a working example (only for dev),
# sharing the HSM device is emulated with a pre-created keypair in the image.
# RUN softhsm2-util --init-token --free --label bank-vaults --so-pin banzai --pin banzai
# RUN pkcs11-tool --module /usr/lib/softhsm/libsofthsm2.so --keypairgen --key-type rsa:2048 --pin banzai --token-label bank-vaults --label bank-vaults
COPY --from=builder /usr/local/bin/bank-vaults /usr/local/bin/bank-vaults
COPY --from=builder /usr/local/bin/template /usr/local/bin/template
USER 65534
ENTRYPOINT ["bank-vaults"]