Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Ubuntu "slim" #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions Dockerfile-ubuntu
Original file line number Diff line number Diff line change
@@ -1,42 +1,38 @@
######################## build ###############################

FROM ubuntu:latest as builder
RUN apt-get update
RUN apt-get install -y build-essential git m4 unzip rsync curl libev-dev libgmp-dev pkg-config libhidapi-dev
RUN apt-get install -y wget libcap2
RUN wget http://security.ubuntu.com/ubuntu/pool/universe/b/bubblewrap/bubblewrap_0.2.1-1_amd64.deb
RUN dpkg -i ./bubblewrap_0.2.1-1_amd64.deb
FROM ubuntu:18.04 as builder
RUN apt-get update && \
apt-get install -y build-essential git m4 unzip rsync curl libev-dev libgmp-dev pkg-config libhidapi-dev libcap2

ARG net=mainnet
RUN git clone https://gitlab.com/tezos/tezos.git
RUN git clone -b $net https://gitlab.com/tezos/tezos.git
WORKDIR tezos
RUN git checkout $net

RUN wget https://github.com/ocaml/opam/releases/download/2.0.0-rc4/opam-2.0.0-rc4-x86_64-linux
RUN mv opam-2.0.0-rc4-x86_64-linux /usr/local/bin/opam
RUN chmod a+x /usr/local/bin/opam
RUN opam init --comp=4.06.1 --disable-sandboxing
RUN opam switch 4.06.1
RUN curl -Lo - https://github.com/ocaml/opam/releases/download/2.0.5/opam-2.0.5-x86_64-linux >/usr/local/bin/opam && \
chmod a+x /usr/local/bin/opam

ENV OPAMROOTISOK=1
RUN opam init --comp=4.06.1 --disable-sandboxing && \
opam switch 4.06.1
RUN opam update
RUN make build-deps
RUN eval $(opam config env) && make
RUN strip tezos-*
RUN mkdir /_scripts && mkdir /_bin
RUN cp -a scripts/docker/entrypoint.sh /_bin/ && \
cp -a scripts/docker/entrypoint.inc.sh /_bin/ && \
cp scripts/alphanet.sh /_scripts/ && \
cp scripts/alphanet_version /_scripts/ && \
cp src/bin_client/bash-completion.sh /_scripts/ && \
cp active_protocol_versions /_scripts/
cp -a scripts/docker/entrypoint.inc.sh /_bin/ && \
cp scripts/alphanet.sh /_scripts/ && \
cp scripts/alphanet_version /_scripts/ && \
cp src/bin_client/bash-completion.sh /_scripts/ && \
cp active_protocol_versions /_scripts/

######################### final ###############################

FROM ubuntu:latest as final
FROM ubuntu:18.04 as final

RUN apt-get update && \
apt-get install -y libev-dev libgmp-dev libhidapi-dev netbase && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN mkdir -p /var/run/tezos/node /var/run/tezos/client
apt-get install -y libev-dev libgmp-dev libhidapi-dev netbase && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY --from=builder /_scripts/* /usr/local/share/tezos/
COPY --from=builder /_bin/* /usr/local/bin/
Expand All @@ -51,6 +47,10 @@ COPY --from=builder /tezos/tezos-protocol-compiler /usr/local/bin/
COPY --from=builder /tezos/tezos-signer /usr/local/bin/

RUN useradd -ms /bin/bash tezos

RUN mkdir -p /var/run/tezos/node /var/run/tezos/client && \
chown tezos /var/run/tezos/node /var/run/tezos/client

USER tezos
ENV USER=tezos

Expand Down