Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
LizJeong authored Jul 15, 2024
1 parent b2fa6d2 commit 7167234
Showing 1 changed file with 10 additions and 24 deletions.
34 changes: 10 additions & 24 deletions .github/workflows/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
ARG OS
ARG ARCH
FROM --platform=$OS/$ARCH golang:1.20
FROM --platform=linux/${ARCH} golang:1.20

ARG OS
ARG ARCH
ARG L1_VERSION
ARG L1_NETWORK_NAME
Expand All @@ -17,32 +15,20 @@ RUN apt-get update && apt-get install -y make tar gzip
COPY . .

# 환경 변수 설정
ENV OS=$OS
ENV ARCH=$ARCH
ENV L1_VERSION=$L1_VERSION
ENV L1_NETWORK_NAME=$L1_NETWORK_NAME
ENV MOVEVM_VERSION=$MOVEVM_VERSION

# 빌드 스크립트 실행
RUN if [ "$OS" = "darwin" ]; then \
cd initia \
&& make build \
&& cd ./build \
&& cp /go/pkg/mod/github.com/initia-labs/movevm@${MOVEVM_VERSION}/api/libmovevm.dylib ./ \
&& cp /go/pkg/mod/github.com/initia-labs/movevm@${MOVEVM_VERSION}/api/libcompiler.dylib ./ \
&& tar -czvf initia_${L1_VERSION}_Darwin_${ARCH}.tar.gz initiad libmovevm.dylib libcompiler.dylib \
&& mkdir -p ../../networks/${L1_NETWORK_NAME}/binaries/ \
&& mv ./initia_${L1_VERSION}_Darwin_${ARCH}.tar.gz ../../networks/${L1_NETWORK_NAME}/binaries/ ; \
elif [ "$OS" = "linux" ]; then \
cd initia \
&& make build-linux-with-shared-library \
&& cd ./build \
&& mv libmovevm.so libmovevm.${ARCH}.so \
&& mv libcompiler.so libcompiler.${ARCH}.so \
&& tar -czvf initia_${L1_VERSION}_Linux_${ARCH}.tar.gz ./initiad libmovevm.${ARCH}.so libcompiler.${ARCH}.so \
&& mkdir -p ../../networks/${L1_NETWORK_NAME}/binaries/ \
&& mv ./initia_${L1_VERSION}_Linux_${ARCH}.tar.gz ../../networks/${L1_NETWORK_NAME}/binaries/ ; \
fi
RUN cd initia \
&& make build-linux-with-shared-library \
&& cd ./build \
&& mv libmovevm.so libmovevm.${ARCH}.so \
&& mv libcompiler.so libcompiler.${ARCH}.so \
&& tar -czvf initia_${L1_VERSION}_Linux_${ARCH}.tar.gz ./initiad libmovevm.${ARCH}.so libcompiler.${ARCH}.so \
&& mkdir -p ../../networks/${L1_NETWORK_NAME}/binaries/ \
&& mv ./initia_${L1_VERSION}_Linux_${ARCH}.tar.gz ../../networks/${L1_NETWORK_NAME}/binaries/

# 결과물 복사
RUN mkdir -p /output && cp networks/${L1_NETWORK_NAME}/binaries/initia_${L1_VERSION}_*_${ARCH}.tar.gz /output/
RUN mkdir -p /output && cp networks/${L1_NETWORK_NAME}/binaries/initia_${L1_VERSION}_Linux_${ARCH}.tar.gz /output/

0 comments on commit 7167234

Please sign in to comment.