-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# stage 1 Build blobstream-ops binary | ||
FROM --platform=$BUILDPLATFORM docker.io/golang:1.21.6-alpine3.18 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 . /blobstream-ops | ||
WORKDIR /blobstream-ops | ||
RUN uname -a &&\ | ||
CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} \ | ||
make build | ||
|
||
# final image | ||
FROM docker.io/alpine:3.20.1 | ||
|
||
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 /blobstream-ops/build/blobstream-ops /bin/blobstream-ops | ||
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" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo "Starting Celestia Blobstream-ops with command:" | ||
echo "$@" | ||
echo "" | ||
|
||
exec "$@" |