Skip to content

Commit

Permalink
Add docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaka committed Jul 25, 2020
1 parent 8e5af93 commit 912118c
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target
.github
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Continuous integration
name: continuous-integration

on:
pull_request:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: deploy

on:
push:
branches:
- master

jobs:
build-push-docker-image:
name: Build and push passive node Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Push to GitHub Packages
uses: docker/build-push-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: tomaka/substrate-lite/node
tag_with_ref: true
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM rust:1 AS builder
LABEL maintainer "Pierre Krieger <[email protected]>"

COPY . /build
WORKDIR /build

RUN apt-get update && apt-get install -y musl-tools
# TODO: don't use nightly once possible
RUN rustup default nightly
RUN rustup target add x86_64-unknown-linux-musl
RUN cargo build --target x86_64-unknown-linux-musl --bin node --release --verbose --all-features


FROM alpine:latest
LABEL maintainer "Pierre Krieger <[email protected]>"
COPY --from=builder /build/target/x86_64-unknown-linux-musl/release/node /usr/local/bin

EXPOSE 30333
CMD ["/usr/local/bin/node"]

0 comments on commit 912118c

Please sign in to comment.