From e18270f33e733f8f6c8e78c280867778db7db469 Mon Sep 17 00:00:00 2001 From: 5chdn <5chdn@users.noreply.github.com> Date: Mon, 1 Oct 2018 13:28:06 +0100 Subject: [PATCH] ci: (re)move dockerfiles --- docker/README.md | 40 ----------------- docker/alpine/Dockerfile | 43 ------------------ docker/centos/Dockerfile | 28 ------------ docker/centos/Dockerfile.build | 25 ----------- docker/centos/build.sh | 29 ------------ docker/ubuntu-aarch64/Dockerfile | 45 ------------------- docker/ubuntu-arm/Dockerfile | 45 ------------------- .../gitlab/hub-docker.file | 0 scripts/gitlab/publish-docker.sh | 2 +- 9 files changed, 1 insertion(+), 256 deletions(-) delete mode 100644 docker/README.md delete mode 100644 docker/alpine/Dockerfile delete mode 100644 docker/centos/Dockerfile delete mode 100644 docker/centos/Dockerfile.build delete mode 100755 docker/centos/build.sh delete mode 100644 docker/ubuntu-aarch64/Dockerfile delete mode 100644 docker/ubuntu-arm/Dockerfile rename docker/hub/Dockerfile => scripts/gitlab/hub-docker.file (100%) diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index 86b2fcb6a..000000000 --- a/docker/README.md +++ /dev/null @@ -1,40 +0,0 @@ -## 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 -``` diff --git a/docker/alpine/Dockerfile b/docker/alpine/Dockerfile deleted file mode 100644 index 47b37372e..000000000 --- a/docker/alpine/Dockerfile +++ /dev/null @@ -1,43 +0,0 @@ -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"] diff --git a/docker/centos/Dockerfile b/docker/centos/Dockerfile deleted file mode 100644 index 22a98c003..000000000 --- a/docker/centos/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -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"] - - - - - diff --git a/docker/centos/Dockerfile.build b/docker/centos/Dockerfile.build deleted file mode 100644 index 454af403a..000000000 --- a/docker/centos/Dockerfile.build +++ /dev/null @@ -1,25 +0,0 @@ -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 - - diff --git a/docker/centos/build.sh b/docker/centos/build.sh deleted file mode 100755 index 7215e745f..000000000 --- a/docker/centos/build.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/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. diff --git a/docker/ubuntu-aarch64/Dockerfile b/docker/ubuntu-aarch64/Dockerfile deleted file mode 100644 index cd8320530..000000000 --- a/docker/ubuntu-aarch64/Dockerfile +++ /dev/null @@ -1,45 +0,0 @@ -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"] diff --git a/docker/ubuntu-arm/Dockerfile b/docker/ubuntu-arm/Dockerfile deleted file mode 100644 index bbdc280d5..000000000 --- a/docker/ubuntu-arm/Dockerfile +++ /dev/null @@ -1,45 +0,0 @@ -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"] diff --git a/docker/hub/Dockerfile b/scripts/gitlab/hub-docker.file similarity index 100% rename from docker/hub/Dockerfile rename to scripts/gitlab/hub-docker.file diff --git a/scripts/gitlab/publish-docker.sh b/scripts/gitlab/publish-docker.sh index c9aeaaf44..16087aaaa 100755 --- a/scripts/gitlab/publish-docker.sh +++ b/scripts/gitlab/publish-docker.sh @@ -17,6 +17,6 @@ export DOCKER_TARGET=$1 echo $DOCKER_TARGET echo "__________Docker build and push__________" -docker build --build-arg TARGET=$DOCKER_TARGET --no-cache=true --tag parity/$DOCKER_TARGET:$DOCKER_BUILD_TAG -f docker/hub/Dockerfile . +docker build --build-arg TARGET=$DOCKER_TARGET --no-cache=true --tag parity/$DOCKER_TARGET:$DOCKER_BUILD_TAG -f scripts/gitlab/hub-docker.file . docker push parity/$DOCKER_TARGET:$DOCKER_BUILD_TAG docker logout