Skip to content

Commit c8072bf

Browse files
committed
Merge branch 'master' of http://github.com/multiversx/mx-chain-mainnet-config into release-v1.7.13.0
2 parents 80b3bde + f7e5459 commit c8072bf

File tree

2 files changed

+39
-21
lines changed

2 files changed

+39
-21
lines changed

.github/workflows/deploy-docker.yaml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ name: Build Docker image & push
77
on:
88
release:
99
types: [published]
10+
pull_request:
1011

1112
jobs:
1213
build-docker-image:
@@ -17,24 +18,31 @@ jobs:
1718

1819
steps:
1920
- name: Check out code into the Go module directory
20-
uses: actions/checkout@v2
21+
uses: actions/checkout@v4
2122

22-
- name: Get the version
23-
id: get_version
24-
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
25-
26-
- name: Build image
27-
run: |
28-
TAG_VERSION=${{ steps.get_version.outputs.VERSION }}
29-
cd ${GITHUB_WORKSPACE} && docker build -t "${REGISTRY_HOSTNAME}/${IMAGE_NODE}:${TAG_VERSION}" -f ./docker/Dockerfile .
30-
31-
- name: Login to Docker Hub
32-
uses: docker/login-action@v2
23+
- name: Extract metadata (tags, labels) for Docker
24+
id: meta
25+
uses: docker/metadata-action@v5
26+
with:
27+
images: ${{ env.REGISTRY_HOSTNAME }}/${{ env.IMAGE_NODE }}
28+
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v3
31+
32+
- name: Log into Docker Hub
33+
if: github.event_name != 'pull_request'
34+
uses: docker/login-action@v3
3335
with:
3436
username: ${{ secrets.DOCKERHUB_USERNAME }}
3537
password: ${{ secrets.DOCKERHUB_TOKEN }}
3638

37-
- name: Push image
38-
run: |
39-
TAG_VERSION=${{ steps.get_version.outputs.VERSION }}
40-
docker push "${REGISTRY_HOSTNAME}/${IMAGE_NODE}:${TAG_VERSION}"
39+
- name: Build and push image to Docker Hub
40+
id: push
41+
uses: docker/build-push-action@v6
42+
with:
43+
context: .
44+
file: ./docker/Dockerfile
45+
platforms: linux/amd64,linux/arm64
46+
push: ${{ github.event_name != 'pull_request' }}
47+
tags: ${{ steps.meta.outputs.tags }}
48+
labels: ${{ steps.meta.outputs.labels }}

docker/Dockerfile

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM golang:1.20.7 as builder
2-
MAINTAINER multiversx
2+
LABEL maintainer="multiversx"
33

44
RUN apt-get update && apt-get install -y
55

@@ -13,8 +13,14 @@ WORKDIR /go/mx-chain-go
1313
# MultiversX node
1414
WORKDIR /go/mx-chain-go/cmd/node
1515
RUN go build -v -ldflags="-X main.appVersion=$(git --git-dir /config/.git describe --tags --long --dirty)"
16-
RUN cp /go/pkg/mod/github.com/multiversx/$(cat /go/mx-chain-go/go.mod | grep mx-chain-vm-v | sort -n | tail -n -1| awk -F '/' '{print$3}'| sed 's/ /@/g')/wasmer/libwasmer_linux_amd64.so /lib/libwasmer_linux_amd64.so
17-
RUN cp /go/pkg/mod/github.com/multiversx/$(cat /go/mx-chain-go/go.mod | grep mx-chain-vm-go | sort -n | tail -n -1| awk -F '/' '{print$3}'| sed 's/ /@/g')/wasmer2/libvmexeccapi.so /lib/libvmexeccapi.so
16+
17+
RUN mkdir -p /lib_amd64 /lib_arm64
18+
19+
RUN cp /go/pkg/mod/github.com/multiversx/$(cat /go/mx-chain-go/go.mod | grep mx-chain-vm-v | sort -n | tail -n -1 | awk -F '/' '{print$3}' | sed 's/ /@/g')/wasmer/libwasmer_linux_amd64.so /lib_amd64/
20+
RUN cp /go/pkg/mod/github.com/multiversx/$(cat /go/mx-chain-go/go.mod | grep mx-chain-vm-go | sort -n | tail -n -1 | awk -F '/' '{print$3}' | sed 's/ /@/g')/wasmer2/libvmexeccapi.so /lib_amd64/
21+
22+
RUN cp /go/pkg/mod/github.com/multiversx/$(cat /go/mx-chain-go/go.mod | grep mx-chain-vm-v | sort -n | tail -n -1 | awk -F '/' '{print$3}' | sed 's/ /@/g')/wasmer/libwasmer_linux_arm64_shim.so /lib_arm64/
23+
RUN cp /go/pkg/mod/github.com/multiversx/$(cat /go/mx-chain-go/go.mod | grep mx-chain-vm-go | sort -n | tail -n -1 | awk -F '/' '{print$3}' | sed 's/ /@/g')/wasmer2/libvmexeccapi_arm.so /lib_arm64/
1824

1925
WORKDIR /config
2026
RUN cp -r * /go/mx-chain-go/cmd/node/config/
@@ -23,10 +29,14 @@ WORKDIR /go/mx-chain-go/cmd/node
2329

2430
# ===== SECOND STAGE ======
2531
FROM ubuntu:22.04
32+
ARG TARGETARCH
2633
RUN apt-get update -y && apt-get upgrade -y
34+
2735
COPY --from=builder "/go/mx-chain-go/cmd/node" "/go/mx-chain-go/cmd/node/"
28-
COPY --from=builder "/lib/libwasmer_linux_amd64.so" "/lib/libwasmer_linux_amd64.so"
29-
COPY --from=builder "/lib/libvmexeccapi.so" "/lib/libvmexeccapi.so"
36+
37+
# Copy architecture-specific files
38+
COPY --from=builder "/lib_${TARGETARCH}/*" "/lib/"
39+
3040
WORKDIR /go/mx-chain-go/cmd/node/
3141
EXPOSE 8080
3242
ENTRYPOINT ["/go/mx-chain-go/cmd/node/node", "--rest-api-interface=:8080"]

0 commit comments

Comments
 (0)