From fb78dce904ff247f14ffea3747fcaf73a27ee8ee Mon Sep 17 00:00:00 2001 From: Simon Kirillov Date: Sat, 19 Mar 2022 00:31:36 +0300 Subject: [PATCH 1/4] Fix Dockerfile and scripts --- DOCKER/Dockerfile | 3 +-- DOCKER/build.sh | 2 +- DOCKER/push.sh | 2 +- Makefile | 5 +---- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/DOCKER/Dockerfile b/DOCKER/Dockerfile index 2785d7e24..a4792981d 100644 --- a/DOCKER/Dockerfile +++ b/DOCKER/Dockerfile @@ -2,7 +2,7 @@ FROM golang:1.17-alpine as builder RUN apk update && \ apk upgrade && \ - apk --no-cache add make + apk --no-cache add make git COPY / /tendermint WORKDIR /tendermint RUN make build-linux @@ -53,4 +53,3 @@ CMD ["start"] # Expose the data directory as a volume since there's mutable state in there VOLUME [ "$TMHOME" ] - diff --git a/DOCKER/build.sh b/DOCKER/build.sh index 2aa42a6cd..0faea11c8 100755 --- a/DOCKER/build.sh +++ b/DOCKER/build.sh @@ -3,7 +3,7 @@ set -e # Get the tag from the version, or try to figure it out. if [ -z "$TAG" ]; then - TAG=$(awk -F\" '/TMCoreSemVer =/ { print $2; exit }' < ../version/version.go) + TAG=$(awk -F\" '/TMVersionDefault =/ { print $2; exit }' < ../version/version.go) fi if [ -z "$TAG" ]; then echo "Please specify a tag." diff --git a/DOCKER/push.sh b/DOCKER/push.sh index f228406d4..040704bfe 100755 --- a/DOCKER/push.sh +++ b/DOCKER/push.sh @@ -3,7 +3,7 @@ set -e # Get the tag from the version, or try to figure it out. if [ -z "$TAG" ]; then - TAG=$(awk -F\" '/TMCoreSemVer =/ { print $2; exit }' < ../version/version.go) + TAG=$(awk -F\" '/TMVersionDefault =/ { print $2; exit }' < ../version/version.go) fi if [ -z "$TAG" ]; then echo "Please specify a tag." diff --git a/Makefile b/Makefile index 13d6ada56..85cd3202d 100644 --- a/Makefile +++ b/Makefile @@ -243,10 +243,8 @@ build-docs: ### Docker image ### ############################################################################### -build-docker: build-linux - cp $(BUILDDIR)/tendermint DOCKER/tendermint +build-docker: docker build --label=tendermint --tag="tendermint/tendermint" -f DOCKER/Dockerfile . - rm -rf DOCKER/tendermint .PHONY: build-docker @@ -343,4 +341,3 @@ split-test-packages:$(BUILDDIR)/packages.txt split -d -n l/$(NUM_SPLIT) $< $<. test-group-%:split-test-packages cat $(BUILDDIR)/packages.txt.$* | xargs go test -mod=readonly -timeout=5m -race -coverprofile=$(BUILDDIR)/$*.profile.out - From dede8d3438a5f365fa9dea380598d415c30ba6a1 Mon Sep 17 00:00:00 2001 From: Simon Kirillov Date: Sat, 19 Mar 2022 00:36:47 +0300 Subject: [PATCH 2/4] Fix docker scripts --- DOCKER/build.sh | 8 ++++---- DOCKER/push.sh | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/DOCKER/build.sh b/DOCKER/build.sh index 0faea11c8..079f8c5d7 100755 --- a/DOCKER/build.sh +++ b/DOCKER/build.sh @@ -6,15 +6,15 @@ if [ -z "$TAG" ]; then TAG=$(awk -F\" '/TMVersionDefault =/ { print $2; exit }' < ../version/version.go) fi if [ -z "$TAG" ]; then - echo "Please specify a tag." - exit 1 + echo "Please specify a tag." + exit 1 fi TAG_NO_PATCH=${TAG%.*} -read -p "==> Build 3 docker images with the following tags (latest, $TAG, $TAG_NO_PATCH)? y/n" -n 1 -r +read -p "==> Build 3 docker images with the following tags (latest, $TAG, $TAG_NO_PATCH)? [y/N] " -n 1 -r echo if [[ $REPLY =~ ^[Yy]$ ]] then - docker build -t "tendermint/tendermint" -t "tendermint/tendermint:$TAG" -t "tendermint/tendermint:$TAG_NO_PATCH" . + docker build -f ./Dockerfile -t "tendermint/tendermint" -t "tendermint/tendermint:$TAG" -t "tendermint/tendermint:$TAG_NO_PATCH" .. fi diff --git a/DOCKER/push.sh b/DOCKER/push.sh index 040704bfe..9ce12f79e 100755 --- a/DOCKER/push.sh +++ b/DOCKER/push.sh @@ -6,13 +6,13 @@ if [ -z "$TAG" ]; then TAG=$(awk -F\" '/TMVersionDefault =/ { print $2; exit }' < ../version/version.go) fi if [ -z "$TAG" ]; then - echo "Please specify a tag." - exit 1 + echo "Please specify a tag." + exit 1 fi TAG_NO_PATCH=${TAG%.*} -read -p "==> Push 3 docker images with the following tags (latest, $TAG, $TAG_NO_PATCH)? y/n" -n 1 -r +read -p "==> Push 3 docker images with the following tags (latest, $TAG, $TAG_NO_PATCH)? [y/N] " -n 1 -r echo if [[ $REPLY =~ ^[Yy]$ ]] then From ef8276a230c51baad204d80a6b8a8ef358d7c411 Mon Sep 17 00:00:00 2001 From: Simon Kirillov Date: Wed, 23 Mar 2022 11:43:33 +0300 Subject: [PATCH 3/4] Remove unused scripts --- DOCKER/.gitignore | 1 - DOCKER/Dockerfile.build_c-amazonlinux | 28 --------------------------- DOCKER/Dockerfile.testing | 16 --------------- DOCKER/Makefile | 13 ------------- DOCKER/build.sh | 20 ------------------- DOCKER/push.sh | 22 --------------------- 6 files changed, 100 deletions(-) delete mode 100644 DOCKER/.gitignore delete mode 100644 DOCKER/Dockerfile.build_c-amazonlinux delete mode 100644 DOCKER/Dockerfile.testing delete mode 100644 DOCKER/Makefile delete mode 100755 DOCKER/build.sh delete mode 100755 DOCKER/push.sh diff --git a/DOCKER/.gitignore b/DOCKER/.gitignore deleted file mode 100644 index 9059c6848..000000000 --- a/DOCKER/.gitignore +++ /dev/null @@ -1 +0,0 @@ -tendermint diff --git a/DOCKER/Dockerfile.build_c-amazonlinux b/DOCKER/Dockerfile.build_c-amazonlinux deleted file mode 100644 index df492d188..000000000 --- a/DOCKER/Dockerfile.build_c-amazonlinux +++ /dev/null @@ -1,28 +0,0 @@ -FROM amazonlinux:2 - -RUN yum -y update && \ - yum -y install wget - -RUN wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \ - rpm -ivh epel-release-latest-7.noarch.rpm - -RUN yum -y groupinstall "Development Tools" -RUN yum -y install leveldb-devel which - -ENV GOVERSION=1.16.5 - -RUN cd /tmp && \ - wget https://dl.google.com/go/go${GOVERSION}.linux-amd64.tar.gz && \ - tar -C /usr/local -xf go${GOVERSION}.linux-amd64.tar.gz && \ - mkdir -p /go/src && \ - mkdir -p /go/bin - -ENV PATH=$PATH:/usr/local/go/bin:/go/bin -ENV GOBIN=/go/bin -ENV GOPATH=/go/src - -RUN mkdir -p /tendermint -WORKDIR /tendermint - -CMD ["/usr/bin/make", "build", "TENDERMINT_BUILD_OPTIONS=cleveldb"] - diff --git a/DOCKER/Dockerfile.testing b/DOCKER/Dockerfile.testing deleted file mode 100644 index 7f86ee180..000000000 --- a/DOCKER/Dockerfile.testing +++ /dev/null @@ -1,16 +0,0 @@ -FROM golang:latest - -# Grab deps (jq, hexdump, xxd, killall) -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - jq bsdmainutils vim-common psmisc netcat - -# Add testing deps for curl -RUN echo 'deb http://httpredir.debian.org/debian testing main non-free contrib' >> /etc/apt/sources.list && \ - apt-get update && \ - apt-get install -y --no-install-recommends curl - -VOLUME /go - -EXPOSE 26656 -EXPOSE 26657 diff --git a/DOCKER/Makefile b/DOCKER/Makefile deleted file mode 100644 index 8f6dff372..000000000 --- a/DOCKER/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -build: - @sh -c "'$(CURDIR)/build.sh'" - -push: - @sh -c "'$(CURDIR)/push.sh'" - -build_testing: - docker build --tag tendermint/testing -f ./Dockerfile.testing . - -build_amazonlinux_buildimage: - docker build -t "tendermint/tendermint:build_c-amazonlinux" -f Dockerfile.build_c-amazonlinux . - -.PHONY: build push build_testing build_amazonlinux_buildimage diff --git a/DOCKER/build.sh b/DOCKER/build.sh deleted file mode 100755 index 079f8c5d7..000000000 --- a/DOCKER/build.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -set -e - -# Get the tag from the version, or try to figure it out. -if [ -z "$TAG" ]; then - TAG=$(awk -F\" '/TMVersionDefault =/ { print $2; exit }' < ../version/version.go) -fi -if [ -z "$TAG" ]; then - echo "Please specify a tag." - exit 1 -fi - -TAG_NO_PATCH=${TAG%.*} - -read -p "==> Build 3 docker images with the following tags (latest, $TAG, $TAG_NO_PATCH)? [y/N] " -n 1 -r -echo -if [[ $REPLY =~ ^[Yy]$ ]] -then - docker build -f ./Dockerfile -t "tendermint/tendermint" -t "tendermint/tendermint:$TAG" -t "tendermint/tendermint:$TAG_NO_PATCH" .. -fi diff --git a/DOCKER/push.sh b/DOCKER/push.sh deleted file mode 100755 index 9ce12f79e..000000000 --- a/DOCKER/push.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash -set -e - -# Get the tag from the version, or try to figure it out. -if [ -z "$TAG" ]; then - TAG=$(awk -F\" '/TMVersionDefault =/ { print $2; exit }' < ../version/version.go) -fi -if [ -z "$TAG" ]; then - echo "Please specify a tag." - exit 1 -fi - -TAG_NO_PATCH=${TAG%.*} - -read -p "==> Push 3 docker images with the following tags (latest, $TAG, $TAG_NO_PATCH)? [y/N] " -n 1 -r -echo -if [[ $REPLY =~ ^[Yy]$ ]] -then - docker push "tendermint/tendermint:latest" - docker push "tendermint/tendermint:$TAG" - docker push "tendermint/tendermint:$TAG_NO_PATCH" -fi