Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(script): output build message and skip pos flag #367

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Loading