-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from celo-org/jcortejoso/celocli-container
Celocli standalone container image
- Loading branch information
Showing
2 changed files
with
68 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,39 @@ | ||
--- | ||
name: Build containers | ||
|
||
on: | ||
release: | ||
types: | ||
- "published" | ||
|
||
jobs: | ||
split-version: | ||
runs-on: ['ubuntu-latest'] | ||
# if: | | ||
# contains(github.event.release.name, '@celo/celocli') | ||
outputs: | ||
CELOCLI_VERSION: ${{ steps.split.outputs.CELOCLI_VERSION }} | ||
steps: | ||
- name: Split celocli-version | ||
id: split | ||
shell: bash | ||
run: | | ||
CELOCLI_VERSION="$(${{ github.event.release.name }}##*@)" | ||
echo "CELOCLI_VERSION=$CELOCLI_VERSION" >> $GITHUB_OUTPUT | ||
# CeloCli standalone image | ||
celocli-standalone: | ||
uses: celo-org/reusable-workflows/.github/workflows/[email protected] | ||
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/celocli:${{ needs.split-version.outputs.CELOCLI_VERSION }} | ||
needs: ['split-version'] | ||
# if: | | ||
# contains(github.event.release.name, '@celo/celocli') | ||
with: | ||
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-developer-tooling/providers/github-by-repos | ||
service-account: '[email protected]' | ||
artifact-registry: us-west1-docker.pkg.dev/devopsre/developer-tooling/celocli | ||
tags: ${{ needs.split-version.outputs.CELOCLI_VERSION }} | ||
context: . | ||
file: packages/cli/standalone.Dockerfile | ||
build-args: VERSION=${{ needs.split-version.outputs.CELOCLI_VERSION }} | ||
trivy: true |
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,29 @@ | ||
# Docker image containing the celocli, built from NPM. | ||
# | ||
# Example build command (manual): | ||
# | ||
# VERSION=x.y.z; docker build . --build-arg VERSION=$VERSION -t celocli-standalone:$VERSION | ||
FROM node:20-alpine | ||
LABEL org.opencontainers.image.authors="[email protected]" | ||
|
||
# Install cli install dependencies. | ||
RUN apk add --no-cache python3 git make gcc g++ bash libusb-dev linux-headers eudev-dev | ||
|
||
# Add an set as default a non-privileged user named celo. | ||
RUN adduser -D -S celo | ||
USER celo | ||
|
||
# Make folders for npm packages. | ||
RUN mkdir /home/celo/.npm-global | ||
ENV PATH=/home/celo/.npm-global/bin:$PATH | ||
ENV NPM_CONFIG_PREFIX=/home/celo/.npm-global | ||
|
||
WORKDIR /home/celo/ | ||
|
||
# Install @celo/celocli from NPM. | ||
ARG VERSION | ||
RUN npm install -g @celo/celocli@$VERSION | ||
RUN celocli config:set --node https://forno.celo.org | ||
|
||
ENTRYPOINT ["celocli"] | ||
CMD ["--help"] |