Skip to content

Commit bcf8ba6

Browse files
Add lcli Dockerfile and auto-build to CI (#2469)
## Issue Addressed Resolves: #2087 ## Proposed Changes - Add a `Dockerfile` to the `lcli` directory - Add a github actions job to build and push and `lcli` docker image on pushes to `unstable` and `stable` ## Additional Info It's a little awkward but `lcli` requires the full project scope so must be built: - from the `lighthouse` dir with: `docker build -f ./lcli/Dockerflie .` - from the `lcli` dir with: `docker build -f ./Dockerfile ../` Didn't include `libssl-dev` or `ca-certificates`, `lcli` doesn't need these right? Co-authored-by: realbigsean <[email protected]> Co-authored-by: Michael Sproul <[email protected]> Co-authored-by: Michael Sproul <[email protected]>
1 parent 9a8320b commit bcf8ba6

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

.github/workflows/docker.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ on:
99
env:
1010
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
1111
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
12-
IMAGE_NAME: sigp/lighthouse
12+
IMAGE_NAME: ${{ github.repository_owner}}/lighthouse
13+
LCLI_IMAGE_NAME: ${{ github.repository_owner }}/lcli
1314

1415
jobs:
1516
extract-branch-name:
@@ -96,3 +97,22 @@ jobs:
9697
--amend ${IMAGE_NAME}:latest-arm64${TAG_SUFFIX} \
9798
--amend ${IMAGE_NAME}:latest-amd64${TAG_SUFFIX};
9899
docker manifest push ${IMAGE_NAME}:latest${TAG_SUFFIX}
100+
build-docker-lcli:
101+
runs-on: ubuntu-18.04
102+
needs: [extract-branch-name]
103+
steps:
104+
- uses: actions/checkout@v2
105+
- name: Dockerhub login
106+
run: |
107+
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
108+
- name: Set Env
109+
if: needs.extract-branch-name.outputs.BRANCH_NAME == 'unstable'
110+
run: |
111+
echo "TAG_SUFFIX=-unstable" >> $GITHUB_ENV;
112+
- name: Build lcli dockerfile (with push)
113+
run: |
114+
docker build \
115+
--build-arg PORTABLE=true \
116+
--tag ${LCLI_IMAGE_NAME}:latest${TAG_SUFFIX} \
117+
--file ./lcli/Dockerfile .
118+
docker push ${LCLI_IMAGE_NAME}:latest${TAG_SUFFIX}

lcli/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# `lcli` requires the full project to be in scope, so this should be built either:
2+
# - from the `lighthouse` dir with the command: `docker build -f ./lcli/Dockerflie .`
3+
# - from the current directory with the command: `docker build -f ./Dockerfile ../`
4+
FROM rust:1.53.0 AS builder
5+
RUN apt-get update && apt-get -y upgrade && apt-get install -y cmake
6+
COPY . lighthouse
7+
ARG PORTABLE
8+
ENV PORTABLE $PORTABLE
9+
RUN cd lighthouse && make install-lcli
10+
11+
FROM debian:buster-slim
12+
RUN apt-get update && apt-get -y upgrade && apt-get clean && rm -rf /var/lib/apt/lists/*
13+
COPY --from=builder /usr/local/cargo/bin/lcli /usr/local/bin/lcli

0 commit comments

Comments
 (0)