-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile
47 lines (35 loc) · 1.07 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
# stage 1 Build blobstreamx-monitor binary
FROM --platform=$BUILDPLATFORM docker.io/golang:1.23.4-alpine3.20 as builder
ARG TARGETOS
ARG TARGETARCH
ENV CGO_ENABLED=0
ENV GO111MODULE=on
RUN apk update && apk --no-cache add make gcc musl-dev git bash
COPY . /blobstreamx-monitor
WORKDIR /blobstreamx-monitor
RUN uname -a &&\
CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
make build
# final image
FROM docker.io/alpine:3.21.0
ARG UID=10001
ARG USER_NAME=celestia
ENV CELESTIA_HOME=/home/${USER_NAME}
# hadolint ignore=DL3018
RUN apk update && apk add --no-cache \
bash \
curl \
jq \
# Creates a user with $UID and $GID=$UID
&& adduser ${USER_NAME} \
-D \
-g ${USER_NAME} \
-h ${CELESTIA_HOME} \
-s /sbin/nologin \
-u ${UID}
COPY --from=builder /blobstreamx-monitor/build/blobstreamx-monitor /bin/blobstreamx-monitor
COPY --chown=${USER_NAME}:${USER_NAME} docker/entrypoint.sh /opt/entrypoint.sh
USER ${USER_NAME}
# p2p port
EXPOSE 30000
ENTRYPOINT [ "/bin/bash", "/opt/entrypoint.sh" ]