Skip to content

Commit

Permalink
Merge pull request #1130 from dusk-network/docker-artifact-build
Browse files Browse the repository at this point in the history
Add Docker artifact build workflow
  • Loading branch information
Fulviuus authored Nov 9, 2023
2 parents ceea487 + ccd2342 commit 842c180
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/docker_image_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build and Upload Docker Image as Artifact

on:
workflow_dispatch:

jobs:
build-and-upload:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build Docker image
run: docker build -t rusk .

- name: Save Docker image
run: docker save rusk:latest -o rusk_image.tar

- name: Upload Docker image as artifact
uses: actions/upload-artifact@v2
with:
name: rusk-image
path: rusk_image.tar
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ ENV RUSK_PROFILE_PATH /.dusk/rusk/
ENV DUSK_CONSENSUS_KEYS_PASS password
EXPOSE 9000/udp

RUN apt-get update && apt-get install -y libssl-dev && rm -rf /var/lib/apt/lists/*

# Copy only the necessary files from the build stage
COPY --from=build-stage /.dusk/rusk /.dusk/rusk
COPY --from=build-stage /opt/rusk/target/release/rusk /opt/rusk/
COPY --from=build-stage /opt/rusk/examples/consensus.keys /.dusk/rusk/consensus.keys
COPY --from=build-stage /opt/rusk/examples/consensus.keys /opt/rusk/consensus.keys
COPY --from=build-stage /tmp/example.state /tmp/example.state

CMD ["./rusk", "-s", "/tmp/example.state", "--consensus-keys-path", "/opt/rusk/consensus.keys"]
CMD ["./rusk", "-s", "/tmp/example.state", "--consensus-keys-path", "/opt/rusk/consensus.keys"]

0 comments on commit 842c180

Please sign in to comment.