Skip to content

Commit

Permalink
chore: change docker
Browse files Browse the repository at this point in the history
  • Loading branch information
aliXsed committed Aug 24, 2023
1 parent 385ac22 commit 72dd0bd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 43 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Docker

on:
push:
tags:
- "[0-9].*"
branches:
- 'hotfix/**'

jobs:

Expand Down Expand Up @@ -36,15 +36,13 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
uses: docker/login-action@v2
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
41 changes: 3 additions & 38 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,6 @@
FROM ubuntu as builder
FROM nodlecode/chain:2.2.2

ARG PROFILE=release
WORKDIR /nodle-chain

COPY . /nodle-chain

RUN apt-get update && \
apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y cmake pkg-config libssl-dev git clang build-essential curl protobuf-compiler
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
export PATH=$PATH:$HOME/.cargo/bin && \
scripts/init.sh && \
cargo build -p nodle-parachain --$PROFILE

# ===== SECOND STAGE ======

FROM ubuntu

ARG PROFILE=release

COPY --from=builder /nodle-chain/target/$PROFILE/nodle-parachain /usr/local/bin

RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y curl netcat

RUN mv /usr/share/ca* /tmp && \
rm -rf /usr/share/* && \
mv /tmp/ca-certificates /usr/share/ && \
rm -rf /usr/lib/python* && \
useradd -m -u 1000 -U -s /bin/sh -d /nodle-chain nodle-chain && \
mkdir -p /nodle-chain/.local/share/nodle-chain && \
chown -R nodle-chain:nodle-chain /nodle-chain/.local && \
ln -s /nodle-chain/.local/share/nodle-chain /data

USER nodle-chain
EXPOSE 30333 9933 9944
VOLUME ["/data"]
RUN mkdir /custom-wasm
ADD ./runtime_eden.compact.compressed.wasm /custom-wasm/runtime_eden.compact.compressed.wasm

ENTRYPOINT ["nodle-parachain"]
Binary file added runtime_eden.compact.compressed.wasm
Binary file not shown.

0 comments on commit 72dd0bd

Please sign in to comment.