-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
36 lines (27 loc) · 943 Bytes
/
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
# Build the application
FROM --platform=$BUILDPLATFORM golang:1.21.3-bookworm as base
ARG build_tags=""
WORKDIR /build
COPY . .
RUN go mod download
ARG TARGETPLATFORM
ARG TARGETARCH
ARG TARGETOS
RUN echo "TARGETARCH: $TARGETARCH"; \
echo "TARGETOS: $TARGETOS"; \
echo "TARGETPLATFORM: $TARGETPLATFORM";
RUN GOARCH=$TARGETARCH GOOS=$TARGETOS go build -tags="${build_tags}" -o ./onchain-merklized-issuer-demo main.go
# Run the application
FROM alpine:3.18.4
RUN apk add --no-cache libstdc++ gcompat libgomp; \
apk add --update busybox>1.3.1-r0; \
apk add --update openssl>3.1.4-r1
RUN apk add doas; \
adduser -S dommyuser -D -G wheel; \
echo 'permit nopass :wheel as root' >> /etc/doas.d/doas.conf;
RUN chmod g+rx,o+rx /
WORKDIR /app
COPY ./keys /app/keys
COPY --from=base /build/onchain-merklized-issuer-demo /app/onchain-merklized-issuer-demo
# Command to run
ENTRYPOINT ["/app/onchain-merklized-issuer-demo"]