Skip to content

Commit

Permalink
fix(script): output build message and skip pos flag (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
johntaiko authored Sep 13, 2024
1 parent 1ca0764 commit 2c881dc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 35 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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=""
Expand All @@ -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

Expand Down
50 changes: 17 additions & 33 deletions script/publish-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 2c881dc

Please sign in to comment.