From ae2118dcca2149740767e734be81fc58bdc7749d Mon Sep 17 00:00:00 2001 From: yp945 Date: Mon, 8 Jul 2024 10:07:50 +0800 Subject: [PATCH] add docker image push ci --- .github/workflows/publish-docker-image.yml | 1 - contrib/images/fiammad/Dockerfile => Dockerfile | 5 ----- Makefile | 11 +++++++++-- contrib/images/Makefile | 13 ------------- scripts/docker/node.docker-compose.yml | 4 ++-- scripts/docker/validator.docker-compose.yml | 8 ++++---- 6 files changed, 15 insertions(+), 27 deletions(-) rename contrib/images/fiammad/Dockerfile => Dockerfile (90%) delete mode 100644 contrib/images/Makefile diff --git a/.github/workflows/publish-docker-image.yml b/.github/workflows/publish-docker-image.yml index a520aa86..0cb67bb2 100644 --- a/.github/workflows/publish-docker-image.yml +++ b/.github/workflows/publish-docker-image.yml @@ -26,6 +26,5 @@ jobs: - name: Build and Push Docker Image uses: docker/build-push-action@v2 with: - file: ./contrib/images/fiammad/Dockerfile push: true tags: fiammachain/fiammad:${{ github.ref == 'refs/tags/*' && github.ref || github.sha }} \ No newline at end of file diff --git a/contrib/images/fiammad/Dockerfile b/Dockerfile similarity index 90% rename from contrib/images/fiammad/Dockerfile rename to Dockerfile index 82da1144..ddaa52df 100644 --- a/contrib/images/fiammad/Dockerfile +++ b/Dockerfile @@ -4,10 +4,7 @@ FROM golang:1.22 AS build-env # TARGETPLATFORM should be one of linux/amd64 or linux/arm64. ARG TARGETPLATFORM="linux/amd64" -# Version to build. Default is empty -ARG VERSION -ARG LEDGER_ENABLED="false" # Cosmos build options ARG COSMOS_BUILD_OPTIONS="" @@ -44,8 +41,6 @@ FROM debian:bookworm-slim AS run RUN apt-get update && apt-get install -y bash curl jq wget pkg-config openssl libssl-dev -# Label should match your github repo -LABEL org.opencontainers.image.source="https://github.com/fiamma-chain/fiammad:${VERSION}" # Install libraries # Cosmwasm - Download correct libwasmvm version diff --git a/Makefile b/Makefile index 3b19d6c0..dc2a4bc6 100644 --- a/Makefile +++ b/Makefile @@ -219,6 +219,13 @@ test: ############################################################################### build-docker: - $(MAKE) -C contrib/images fiammad + docker build \ + -t fiammachain/fiammad \ + --build-arg GIT_VERSION=$(VERSION) \ + --build-arg GIT_COMMIT=$(COMMIT) \ + -f Dockerfile . -.PHONY: build-docker \ No newline at end of file +docker-rmi: + docker rmi fiammachain/fiammad 2>/dev/null; true + +.PHONY: build-docker docker-rmi \ No newline at end of file diff --git a/contrib/images/Makefile b/contrib/images/Makefile deleted file mode 100644 index c8dccdc8..00000000 --- a/contrib/images/Makefile +++ /dev/null @@ -1,13 +0,0 @@ - - -all: fiammad - -fiammad: fiammad-rmi - docker build --tag fiammachain/fiammad -f fiammad/Dockerfile \ - $(shell git rev-parse --show-toplevel) - -fiammad-rmi: - docker rmi fiammachain/fiammad 2>/dev/null; true - - -.PHONY: all fiammad fiammad-rmi diff --git a/scripts/docker/node.docker-compose.yml b/scripts/docker/node.docker-compose.yml index 3e42fa79..2beac393 100644 --- a/scripts/docker/node.docker-compose.yml +++ b/scripts/docker/node.docker-compose.yml @@ -5,7 +5,7 @@ services: image: fiammachain/fiammad build: context: ../../ - dockerfile: ../../contrib/images/fiammad/Dockerfile + dockerfile: ../../Dockerfile volumes: - ../testnet-nodes/${NODE_NAME}:/root/.fiamma - ../setup_node.sh:/entrypoint.sh @@ -14,7 +14,7 @@ services: node-runner: image: fiammachain/fiammad build: - dockerfile: ../../contrib/images/fiammad/Dockerfile + dockerfile: ../../Dockerfile volumes: - ../testnet-nodes/${NODE_NAME}:/root/.fiamma command: start diff --git a/scripts/docker/validator.docker-compose.yml b/scripts/docker/validator.docker-compose.yml index ef513f33..82af6bd8 100644 --- a/scripts/docker/validator.docker-compose.yml +++ b/scripts/docker/validator.docker-compose.yml @@ -5,7 +5,7 @@ services: image: fiammachain/fiammad build: context: ../../ - dockerfile: ./contrib/images/fiammad/Dockerfile + dockerfile: ../../Dockerfile volumes: - ../testnet-nodes/${NODE_NAME}:/root/.fiamma - ../setup_node.sh:/entrypoint.sh @@ -14,8 +14,8 @@ services: validator-setup: image: fiammachain/fiammad build: - context: ../ - dockerfile: ./contrib/images/fiammad/Dockerfile + context: ../../ + dockerfile: ../../Dockerfile volumes: - ../testnet-nodes/${NODE_NAME}:/root/.fiamma - ../setup_validator.sh:/entrypoint.sh @@ -25,7 +25,7 @@ services: image: fiammachain/fiammad build: context: ../../ - dockerfile: ./contrib/images/fiammad/Dockerfile + dockerfile: ../../Dockerfile ports: - 26656:26656 - 26657:26657