ci: restore docker files
This commit is contained in:
parent
4da8e25e83
commit
f4774c57af
40
scripts/docker/README.md
Normal file
40
scripts/docker/README.md
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
## Usage
|
||||||
|
|
||||||
|
```docker build -f docker/ubuntu/Dockerfile --tag ethcore/parity:branch_or_tag_name .```
|
||||||
|
|
||||||
|
## Usage - CentOS
|
||||||
|
|
||||||
|
Builds a lightweight non-root Parity docker image:
|
||||||
|
```
|
||||||
|
git clone https://github.com/paritytech/parity-ethereum.git
|
||||||
|
cd parity-ethereum
|
||||||
|
./docker/centos/build.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Fully customised build:
|
||||||
|
```
|
||||||
|
PARITY_IMAGE_REPO=my-personal/parity \
|
||||||
|
PARITY_BUILDER_IMAGE_TAG=build-latest \
|
||||||
|
PARITY_RUNNER_IMAGE_TAG=centos-parity-experimental \
|
||||||
|
./docker/centos/build.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Default values:
|
||||||
|
```
|
||||||
|
# The image name
|
||||||
|
PARITY_IMAGE_REPO - parity/parity
|
||||||
|
|
||||||
|
# The tag to be used for builder image, git commit sha will be appended
|
||||||
|
PARITY_BUILDER_IMAGE_TAG - build
|
||||||
|
|
||||||
|
# The tag to be used for runner image
|
||||||
|
PARITY_RUNNER_IMAGE_TAG - latest
|
||||||
|
```
|
||||||
|
|
||||||
|
All default ports you might use will be exposed:
|
||||||
|
```
|
||||||
|
# secret
|
||||||
|
# ipfs store ui rpc ws listener discovery
|
||||||
|
# ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
||||||
|
EXPOSE 5001 8082 8083 8180 8545 8546 30303/tcp 30303/udp
|
||||||
|
```
|
43
scripts/docker/alpine/Dockerfile
Normal file
43
scripts/docker/alpine/Dockerfile
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
FROM alpine:edge AS builder
|
||||||
|
|
||||||
|
# show backtraces
|
||||||
|
ENV RUST_BACKTRACE 1
|
||||||
|
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
build-base \
|
||||||
|
cargo \
|
||||||
|
cmake \
|
||||||
|
eudev-dev \
|
||||||
|
linux-headers \
|
||||||
|
perl \
|
||||||
|
rust
|
||||||
|
|
||||||
|
WORKDIR /parity
|
||||||
|
COPY . /parity
|
||||||
|
RUN cargo build --release --target x86_64-alpine-linux-musl --verbose
|
||||||
|
RUN strip target/x86_64-alpine-linux-musl/release/parity
|
||||||
|
|
||||||
|
|
||||||
|
FROM alpine:edge
|
||||||
|
|
||||||
|
# show backtraces
|
||||||
|
ENV RUST_BACKTRACE 1
|
||||||
|
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
libstdc++ \
|
||||||
|
eudev-libs \
|
||||||
|
libgcc
|
||||||
|
|
||||||
|
RUN addgroup -g 1000 parity \
|
||||||
|
&& adduser -u 1000 -G parity -s /bin/sh -D parity
|
||||||
|
|
||||||
|
USER parity
|
||||||
|
|
||||||
|
EXPOSE 8080 8545 8180
|
||||||
|
|
||||||
|
WORKDIR /home/parity
|
||||||
|
|
||||||
|
RUN mkdir -p /home/parity/.local/share/io.parity.ethereum/
|
||||||
|
COPY --chown=parity:parity --from=builder /parity/target/x86_64-alpine-linux-musl/release/parity ./
|
||||||
|
|
||||||
|
ENTRYPOINT ["./parity"]
|
28
scripts/docker/centos/Dockerfile
Normal file
28
scripts/docker/centos/Dockerfile
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
FROM centos:latest
|
||||||
|
|
||||||
|
RUN mkdir -p /opt/parity/data && \
|
||||||
|
chmod g+rwX /opt/parity/data && \
|
||||||
|
mkdir -p /opt/parity/release
|
||||||
|
|
||||||
|
COPY parity/parity /opt/parity/release
|
||||||
|
|
||||||
|
WORKDIR /opt/parity/data
|
||||||
|
|
||||||
|
# exposing default ports
|
||||||
|
#
|
||||||
|
# secret
|
||||||
|
# ipfs store ui rpc ws listener discovery
|
||||||
|
# ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
||||||
|
EXPOSE 5001 8082 8083 8180 8545 8546 30303/tcp 30303/udp
|
||||||
|
|
||||||
|
# switch to non-root user
|
||||||
|
USER 1001
|
||||||
|
|
||||||
|
#if no base path provided, assume it's current workdir
|
||||||
|
CMD ["--base-path","."]
|
||||||
|
ENTRYPOINT ["/opt/parity/release/parity"]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
25
scripts/docker/centos/Dockerfile.build
Normal file
25
scripts/docker/centos/Dockerfile.build
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
FROM centos:latest
|
||||||
|
|
||||||
|
WORKDIR /build
|
||||||
|
|
||||||
|
ADD . /build/parity-ethereum
|
||||||
|
|
||||||
|
RUN yum -y update && \
|
||||||
|
yum install -y systemd-devel git make gcc-c++ gcc file binutils && \
|
||||||
|
curl -L "https://cmake.org/files/v3.12/cmake-3.12.0-Linux-x86_64.tar.gz" -o cmake.tar.gz && \
|
||||||
|
tar -xzf cmake.tar.gz && \
|
||||||
|
cp -r cmake-3.12.0-Linux-x86_64/* /usr/ && \
|
||||||
|
curl https://sh.rustup.rs -sSf | sh -s -- -y && \
|
||||||
|
PATH=/root/.cargo/bin:$PATH && \
|
||||||
|
RUST_BACKTRACE=1 && \
|
||||||
|
rustc -vV && \
|
||||||
|
cargo -V && \
|
||||||
|
gcc -v && \
|
||||||
|
g++ -v && \
|
||||||
|
cmake --version && \
|
||||||
|
cd parity-ethereum && \
|
||||||
|
cargo build --verbose --release --features final && \
|
||||||
|
strip /build/parity-ethereum/target/release/parity && \
|
||||||
|
file /build/parity-ethereum/target/release/parity
|
||||||
|
|
||||||
|
|
29
scripts/docker/centos/build.sh
Executable file
29
scripts/docker/centos/build.sh
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
# The image name
|
||||||
|
PARITY_IMAGE_REPO=${PARITY_IMAGE_REPO:-parity/parity}
|
||||||
|
# The tag to be used for builder image
|
||||||
|
PARITY_BUILDER_IMAGE_TAG=${PARITY_BUILDER_IMAGE_TAG:-build}
|
||||||
|
# The tag to be used for runner image
|
||||||
|
PARITY_RUNNER_IMAGE_TAG=${PARITY_RUNNER_IMAGE_TAG:-latest}
|
||||||
|
|
||||||
|
echo Building $PARITY_IMAGE_REPO:$PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H")
|
||||||
|
docker build --no-cache -t $PARITY_IMAGE_REPO:$PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H") . -f docker/centos/Dockerfile.build
|
||||||
|
|
||||||
|
echo Creating $PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H"), extracting binary
|
||||||
|
docker create --name extract $PARITY_IMAGE_REPO:$PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H")
|
||||||
|
mkdir docker/centos/parity
|
||||||
|
docker cp extract:/build/parity-ethereum/target/release/parity docker/centos/parity
|
||||||
|
|
||||||
|
echo Building $PARITY_IMAGE_REPO:$PARITY_RUNNER_IMAGE_TAG
|
||||||
|
docker build --no-cache -t $PARITY_IMAGE_REPO:$PARITY_RUNNER_IMAGE_TAG docker/centos/ -f docker/centos/Dockerfile
|
||||||
|
|
||||||
|
echo Cleaning up ...
|
||||||
|
rm -rf docker/centos/parity
|
||||||
|
docker rm -f extract
|
||||||
|
docker rmi -f $PARITY_IMAGE_REPO:$PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H")
|
||||||
|
|
||||||
|
echo Echoing Parity version:
|
||||||
|
docker run $PARITY_IMAGE_REPO:$PARITY_RUNNER_IMAGE_TAG --version
|
||||||
|
|
||||||
|
echo Done.
|
27
scripts/docker/hub/Dockerfile
Normal file
27
scripts/docker/hub/Dockerfile
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
FROM ubuntu:xenial
|
||||||
|
MAINTAINER Parity Technologies <devops@parity.io>
|
||||||
|
#set ENVIROMENT
|
||||||
|
ARG TARGET
|
||||||
|
ENV TARGET ${TARGET}
|
||||||
|
|
||||||
|
# install tools and dependencies
|
||||||
|
RUN apt update && apt install -y --no-install-recommends openssl libudev-dev file
|
||||||
|
|
||||||
|
# show backtraces
|
||||||
|
ENV RUST_BACKTRACE 1
|
||||||
|
|
||||||
|
#cleanup Docker image
|
||||||
|
RUN apt autoremove -y
|
||||||
|
RUN apt clean -y
|
||||||
|
RUN rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
#add TARGET to docker image
|
||||||
|
COPY artifacts/x86_64-unknown-linux-gnu/$TARGET /usr/bin/$TARGET
|
||||||
|
|
||||||
|
# Build a shell script because the ENTRYPOINT command doesn't like using ENV
|
||||||
|
RUN echo "#!/bin/bash \n ${TARGET} \$@" > ./entrypoint.sh
|
||||||
|
RUN chmod +x ./entrypoint.sh
|
||||||
|
|
||||||
|
# setup ENTRYPOINT
|
||||||
|
EXPOSE 5001 8080 8082 8083 8545 8546 8180 30303/tcp 30303/udp
|
||||||
|
ENTRYPOINT ["./entrypoint.sh"]
|
45
scripts/docker/ubuntu-aarch64/Dockerfile
Normal file
45
scripts/docker/ubuntu-aarch64/Dockerfile
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
FROM ubuntu:14.04
|
||||||
|
WORKDIR /build
|
||||||
|
|
||||||
|
# install tools and dependencies
|
||||||
|
RUN apt-get -y update && \
|
||||||
|
apt-get install -y --force-yes --no-install-recommends \
|
||||||
|
curl git make g++ gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
|
||||||
|
libc6-arm64-cross libc6-dev-arm64-cross wget file ca-certificates \
|
||||||
|
binutils-aarch64-linux-gnu cmake3 libudev-dev \
|
||||||
|
&& \
|
||||||
|
apt-get clean
|
||||||
|
|
||||||
|
# install rustup
|
||||||
|
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
|
||||||
|
|
||||||
|
# rustup directory
|
||||||
|
ENV PATH /root/.cargo/bin:$PATH
|
||||||
|
|
||||||
|
ENV RUST_TARGETS="aarch64-unknown-linux-gnu"
|
||||||
|
|
||||||
|
# multirust add arm--linux-gnuabhf toolchain
|
||||||
|
RUN rustup target add aarch64-unknown-linux-gnu
|
||||||
|
|
||||||
|
# show backtraces
|
||||||
|
ENV RUST_BACKTRACE 1
|
||||||
|
|
||||||
|
# show tools
|
||||||
|
RUN rustc -vV && cargo -V
|
||||||
|
|
||||||
|
# build parity
|
||||||
|
ADD . /build/parity
|
||||||
|
RUN cd parity && \
|
||||||
|
mkdir -p .cargo && \
|
||||||
|
echo '[target.aarch64-unknown-linux-gnu]\n\
|
||||||
|
linker = "aarch64-linux-gnu-gcc"\n'\
|
||||||
|
>>.cargo/config && \
|
||||||
|
cat .cargo/config && \
|
||||||
|
cargo build --target aarch64-unknown-linux-gnu --release --verbose && \
|
||||||
|
ls /build/parity/target/aarch64-unknown-linux-gnu/release/parity && \
|
||||||
|
/usr/bin/aarch64-linux-gnu-strip /build/parity/target/aarch64-unknown-linux-gnu/release/parity
|
||||||
|
|
||||||
|
RUN file /build/parity/target/aarch64-unknown-linux-gnu/release/parity
|
||||||
|
|
||||||
|
EXPOSE 8080 8545 8180
|
||||||
|
ENTRYPOINT ["/build/parity/target/aarch64-unknown-linux-gnu/release/parity"]
|
45
scripts/docker/ubuntu-arm/Dockerfile
Normal file
45
scripts/docker/ubuntu-arm/Dockerfile
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
FROM ubuntu:14.04
|
||||||
|
WORKDIR /build
|
||||||
|
|
||||||
|
# install tools and dependencies
|
||||||
|
RUN apt-get -y update && \
|
||||||
|
apt-get install -y --force-yes --no-install-recommends \
|
||||||
|
curl git make g++ gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf \
|
||||||
|
libc6-dev-armhf-cross wget file ca-certificates \
|
||||||
|
binutils-arm-linux-gnueabihf cmake3 libudev-dev \
|
||||||
|
&& \
|
||||||
|
apt-get clean
|
||||||
|
|
||||||
|
# install rustup
|
||||||
|
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
|
||||||
|
|
||||||
|
# rustup directory
|
||||||
|
ENV PATH /root/.cargo/bin:$PATH
|
||||||
|
|
||||||
|
ENV RUST_TARGETS="arm-unknown-linux-gnueabihf"
|
||||||
|
|
||||||
|
# multirust add arm--linux-gnuabhf toolchain
|
||||||
|
RUN rustup target add armv7-unknown-linux-gnueabihf
|
||||||
|
|
||||||
|
# show backtraces
|
||||||
|
ENV RUST_BACKTRACE 1
|
||||||
|
|
||||||
|
# show tools
|
||||||
|
RUN rustc -vV && cargo -V
|
||||||
|
|
||||||
|
# build parity
|
||||||
|
ADD . /build/parity
|
||||||
|
RUN cd parity && \
|
||||||
|
mkdir -p .cargo && \
|
||||||
|
echo '[target.armv7-unknown-linux-gnueabihf]\n\
|
||||||
|
linker = "arm-linux-gnueabihf-gcc"\n'\
|
||||||
|
>>.cargo/config && \
|
||||||
|
cat .cargo/config && \
|
||||||
|
cargo build --target armv7-unknown-linux-gnueabihf --release --verbose && \
|
||||||
|
ls /build/parity/target/armv7-unknown-linux-gnueabihf/release/parity && \
|
||||||
|
/usr/bin/arm-linux-gnueabihf-strip /build/parity/target/armv7-unknown-linux-gnueabihf/release/parity
|
||||||
|
|
||||||
|
RUN file /build/parity/target/armv7-unknown-linux-gnueabihf/release/parity
|
||||||
|
|
||||||
|
EXPOSE 8080 8545 8180
|
||||||
|
ENTRYPOINT ["/build/parity/target/armv7-unknown-linux-gnueabihf/release/parity"]
|
Loading…
Reference in New Issue
Block a user