diff --git a/Dockerfile b/Dockerfile index 653571ec..3dcc313b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.75.0 as builder +FROM rust:1.75.0 AS builder ENV DEBIAN_FRONTEND=noninteractive ARG BUILD_FLAGS="" @@ -12,7 +12,7 @@ WORKDIR /opt/raiko COPY . . RUN cargo build --release ${BUILD_FLAGS} --features "sgx" --features "docker_build" -FROM gramineproject/gramine:1.6-jammy as runtime +FROM gramineproject/gramine:1.6-jammy AS runtime ENV DEBIAN_FRONTEND=noninteractive WORKDIR /opt/raiko diff --git a/script/publish-image.sh b/script/publish-image.sh index e4d64fbf..4951f4a7 100755 --- a/script/publish-image.sh +++ b/script/publish-image.sh @@ -2,41 +2,25 @@ set -x set -eo pipefail -features=( - "pos" - "none" -) +sgx_flags=$1 +if [[ -n "$sgx_flags" ]]; then + build_flags="${build_flags} --build-arg EDMM=${sgx_flags}" +fi -for feature in "${features[@]}"; do - if [[ "${feature}" != "$1" ]]; then - continue - fi +tag=$2 - tag=$3 +if [[ -z "$tag" ]]; then + tag="latest" +fi - if [[ -z "$tag" ]]; then - tag="latest" - fi +echo "Build and push $1:$tag..." +docker buildx build ./ \ + --load \ + --platform linux/amd64 \ + -t raiko:$tag \ + --build-arg TARGETPLATFORM=linux/amd64 \ + --progress=plain - build_flags="" - if [[ "$feature" != "none" ]]; then - tag="${tag}-${feature}" - build_flags="--build-arg BUILD_FLAGS=--features=${feature}" - fi +docker tag raiko:$tag us-docker.pkg.dev/evmchain/images/raiko:$tag - sgx_flags=$2 - if [[ -n "$sgx_flags" ]]; then - build_flags="${build_flags} --build-arg EDMM=${sgx_flags}" - fi - - echo "Build and push $1:$tag..." - docker buildx build ./ \ - --platform linux/amd64 \ - -t raiko:$tag \ - $build_flags \ - --build-arg TARGETPLATFORM=linux/amd64 - - docker tag raiko:$tag us-docker.pkg.dev/evmchain/hekla/raiko:$tag - - echo "Done" -done +echo "Done"