-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
55 lines (43 loc) · 1.75 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#Create subkey bin
FROM debian:buster as builder-subkey
# Install subkey tool
WORKDIR /root/
RUN apt-get -y update; \
apt-get install -y --no-install-recommends \
cmake pkg-config libssl-dev git gcc build-essential clang libclang-dev curl ca-certificates
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup toolchain install nightly-2020-10-06
RUN rustup default nightly-2020-10-06
RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2020-10-06
###########################
# Build subkey tool step
###########################
RUN git clone https://github.com/paritytech/substrate
RUN cd substrate && git checkout v2.0.1 && cargo build -p subkey --release
FROM node:10-buster
ENV NODE_NO_WARNINGS 1
ENV user node
ENV PATH=/home/node/.npm-global/bin:$PATH
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
# Add debian unstable repo for wireguard packages
RUN echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable-wireguard.list && \
printf 'Package: *\nPin: release a=unstable\nPin-Priority: 90\n' > /etc/apt/preferences.d/limit-unstable
# Installing necessary packages
RUN apt-get -y update && \
apt-get install -y --no-install-recommends \
wireguard-tools zip iptables net-tools procps && \
echo "resolvconf resolvconf/linkify-resolvconf boolean false" | debconf-set-selections && \
apt install -y resolvconf && \
apt clean
# Copy subkey
COPY --from=builder-subkey /root/substrate/target/release/subkey /usr/local/bin/
RUN mkdir /home/$user/app
COPY . /home/$user/app/
RUN chown -R $user: /home/$user/app
USER $user
RUN mkdir /home/$user/.npm-global
WORKDIR /home/$user/app
RUN npm install
RUN npm -g install . --no-optional
ENTRYPOINT [ "archipel-cli" ]