Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

chore: adaptations to dockerFile. Bumping ci workflow version #462

Merged
merged 5 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
permissions:
contents: write
packages: write
uses: celestiaorg/.github/.github/workflows/reusable_dockerfile_pipeline.yml@v0.2.2 # yamllint disable-line rule:line-length
uses: celestiaorg/.github/.github/workflows/reusable_dockerfile_pipeline.yml@v0.2.3 # yamllint disable-line rule:line-length
with:
dockerfile: Dockerfile
27 changes: 23 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
# stage 1 Build qgb binary
FROM golang:1.21.1-alpine as builder
RUN apk update && apk --no-cache add make gcc musl-dev git
FROM --platform=$BUILDPLATFORM docker.io/golang:1.21-alpine3.18 as builder
rach-id marked this conversation as resolved.
Show resolved Hide resolved
RUN apk update && apk --no-cache add make gcc musl-dev git bash

COPY . /orchestrator-relayer
WORKDIR /orchestrator-relayer
RUN make build

# final image
FROM alpine:3.18.3
FROM --platform=$BUILDPLATFORM docker.io/alpine:3.18.3

ARG UID=10001
ARG USER_NAME=celestia
Comment on lines +12 to +13
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically, we are aligning all DockerFiles into 1 style like we have in app and node, where there is a celestia user and not root anymore. Let me know if this is fine for the orchestrator-relayer

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure :D Thanks


ENV CELESTIA_HOME=/home/${USER_NAME}

# hadolint ignore=DL3018
RUN apk update && apk --no-cache add bash
RUN apk update && apk add --no-cache \
bash \
curl \
jq \
# Creates a user with $UID and $GID=$UID
&& adduser ${USER_NAME} \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be failing in docker CI:

93 Usage: adduser [OPTIONS] USER [GROUP]
  #10 1.493 
  #10 1.493 Create new user, or add USER to GROUP
  #10 1.493 
  #10 1.493 	-h DIR		Home directory
  #10 1.493 	-g GECOS	GECOS field
  #10 1.493 	-s SHELL	Login shell
  #10 1.493 	-G GRP		Group
  #10 1.493 	-S		Create a system user
  #10 1.493 	-D		Don't assign a password
  #10 1.493 	-H		Don't create home directory
  #10 1.493 	-u UID		User id
  #10 1.493 	-k SKEL		Skeleton directory (/etc/skel)
  #10 ERROR: process "/bin/sh -c apk update && apk add --no-cache         bash         curl         jq     && adduser ${USER_NAME}         -D         -g ${USER_NAME}         -h ${CELESTIA_HOME}         -s /sbin/nologin         -u ${UID}" did not complete successfully: exit code:  1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review ❤️
I totally forgot to point the home directory actually....

-D \
-g ${USER_NAME} \
-h ${CELESTIA_HOME} \
-s /sbin/nologin \
-u ${UID}

COPY --from=builder /orchestrator-relayer/build/qgb /bin/qgb
COPY --chown=${USER_NAME}:${USER_NAME} docker/entrypoint.sh /opt/entrypoint.sh

USER ${USER_NAME}

# p2p port
EXPOSE 30000

Expand Down