diff --git a/Makefile b/Makefile index e81fce3..96ee688 100644 --- a/Makefile +++ b/Makefile @@ -6,38 +6,38 @@ IMAGE_VERSION := ${RUST_VERSION} bionic/Dockerfile: gen-dockerfiles templates/bionic.Dockerfile python3 gen-dockerfiles -centos-7/Dockerfile: gen-dockerfiles templates/centos-7.Dockerfile +ubuntu-20.04/Dockerfile: gen-dockerfiles templates/ubuntu-20.04.Dockerfile python3 gen-dockerfiles aarch64/Dockerfile: gen-dockerfiles templates/aarch64.Dockerfile python3 gen-dockerfiles -build-all: build-bionic build-centos-7 build-aarch64 +build-all: build-bionic build-ubuntu-20.04 build-aarch64 build-bionic: bionic/Dockerfile docker build -f bionic/Dockerfile --tag ${DOCKERHUB_REPO}:bionic-${IMAGE_VERSION} . -build-centos-7: centos-7/Dockerfile - docker build -f centos-7/Dockerfile --tag ${DOCKERHUB_REPO}:centos-7-${IMAGE_VERSION} . +build-ubuntu-20.04: ubuntu-20.04/Dockerfile + docker build -f ubuntu-20.04/Dockerfile --tag ${DOCKERHUB_REPO}:ubuntu-20.04-${IMAGE_VERSION} . build-aarch64: aarch64/Dockerfile docker build -f aarch64/Dockerfile --tag ${DOCKERHUB_REPO}:aarch64-${IMAGE_VERSION} . -.PHONY: build-all build-bionic build-centos-7 build-aarch64 -push-all: push-bionic push-centos-7 push-aarch64 +.PHONY: build-all build-bionic build-ubuntu-20.04 build-aarch64 +push-all: push-bionic push-ubuntu-20.04 push-aarch64 push-bionic: build-bionic docker push ${DOCKERHUB_REPO}:bionic-${IMAGE_VERSION} -push-centos-7: build-centos-7 - docker push ${DOCKERHUB_REPO}:centos-7-${IMAGE_VERSION} +push-ubuntu-20.04: build-ubuntu-20.04 + docker push ${DOCKERHUB_REPO}:ubuntu-20.04-${IMAGE_VERSION} push-aarch64: build-aarch64 docker push ${DOCKERHUB_REPO}:aarch64-${IMAGE_VERSION} -.PHONY: push-all push-bionic push-centos-7 push-aarch64 +.PHONY: push-all push-bionic push-ubuntu-20.04 push-aarch64 -test-all: test-bionic test-centos-7 +test-all: test-bionic test-ubuntu-20.04 sync-ckb: if [ -d ckb ]; then git -C ckb pull; else git clone --depth 1 https://github.com/nervosnetwork/ckb.git; fi @@ -45,7 +45,7 @@ sync-ckb: test-bionic: sync-ckb docker run --rm -it -w /ckb -v "$$(pwd)/ckb:/ckb" ${DOCKERHUB_REPO}:bionic-${IMAGE_VERSION} make prod -test-centos-7: sync-ckb - docker run --rm -it -w /ckb -v "$$(pwd)/ckb:/ckb" ${DOCKERHUB_REPO}:centos-7-${IMAGE_VERSION} make prod +test-ubuntu-20.04: sync-ckb + docker run --rm -it -w /ckb -v "$$(pwd)/ckb:/ckb" ${DOCKERHUB_REPO}:ubuntu-20.04-${IMAGE_VERSION} make prod -.PHONY: test-all test-bionic test-centos-7 sync-ckb +.PHONY: test-all test-bionic test-ubuntu-20.04 sync-ckb diff --git a/gen-dockerfiles b/gen-dockerfiles index 287284a..d82783d 100755 --- a/gen-dockerfiles +++ b/gen-dockerfiles @@ -10,7 +10,7 @@ DISTRIBUTIONS = { # Ubuntu 'bionic': 'x86_64-unknown-linux-gnu', # CentOS - 'centos-7': 'x86_64-unknown-linux-gnu', + 'ubuntu-20.04': 'x86_64-unknown-linux-gnu', # Arch64 'aarch64': 'aarch64-unknown-linux-gnu', } diff --git a/templates/centos-7.Dockerfile b/templates/ubuntu-20.04.Dockerfile similarity index 58% rename from templates/centos-7.Dockerfile rename to templates/ubuntu-20.04.Dockerfile index 4d331d3..a505d94 100644 --- a/templates/centos-7.Dockerfile +++ b/templates/ubuntu-20.04.Dockerfile @@ -3,16 +3,9 @@ FROM centos:7 ENV PATH=/root/.cargo/bin:$PATH RUN set -eux; \ - sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/CentOS-*.repo; \ - sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/CentOS-*.repo; \ - sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/CentOS-*.repo; \ - yum install -y centos-release-scl; \ - sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/CentOS-*.repo; \ - sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/CentOS-*.repo; \ - sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/CentOS-*.repo; \ - yum install -y git curl make devtoolset-8 llvm-toolset-7 perl-core pcre-devel wget zlib-devel; \ - yum clean all; \ - rm -rf /var/cache/yum + apt install -y git curl make devtoolset-8 llvm-toolset-7 perl-core pcre-devel wget zlib-devel; \ + apt clean all; \ + rm -rf /var/cache/apt ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ @@ -40,7 +33,7 @@ RUN set -eux; \ RUN git config --global --add safe.directory /ckb RUN git config --global --add safe.directory /ckb-cli -COPY centos-7/entrypoint.sh / +COPY ubuntu-20.04/entrypoint.sh / ENTRYPOINT ["/entrypoint.sh"] CMD ["bash"] diff --git a/centos-7/Dockerfile b/ubuntu-20.04/Dockerfile similarity index 56% rename from centos-7/Dockerfile rename to ubuntu-20.04/Dockerfile index 6275afd..24a2de2 100644 --- a/centos-7/Dockerfile +++ b/ubuntu-20.04/Dockerfile @@ -3,16 +3,7 @@ FROM centos:7 ENV PATH=/root/.cargo/bin:$PATH RUN set -eux; \ - sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/CentOS-*.repo; \ - sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/CentOS-*.repo; \ - sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/CentOS-*.repo; \ - yum install -y centos-release-scl; \ - sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/CentOS-*.repo; \ - sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/CentOS-*.repo; \ - sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/CentOS-*.repo; \ - yum install -y git curl make devtoolset-8 llvm-toolset-7 perl-core pcre-devel wget zlib-devel; \ - yum clean all; \ - rm -rf /var/cache/yum + apt install -y git curl make ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ @@ -40,7 +31,7 @@ RUN set -eux; \ RUN git config --global --add safe.directory /ckb RUN git config --global --add safe.directory /ckb-cli -COPY centos-7/entrypoint.sh / +COPY ubuntu-20.04/entrypoint.sh / ENTRYPOINT ["/entrypoint.sh"] CMD ["bash"] diff --git a/centos-7/entrypoint.sh b/ubuntu-20.04/entrypoint.sh similarity index 100% rename from centos-7/entrypoint.sh rename to ubuntu-20.04/entrypoint.sh