Skip to content

Commit

Permalink
chore(docker): fix docker build (#237)
Browse files Browse the repository at this point in the history
* fix docker build

Signed-off-by: smtmfft <smtm@taiko.xyz>

* fix: some docker stuff (#239)

---------

Signed-off-by: smtmfft <smtm@taiko.xyz>
Co-authored-by: johntaiko <john@taiko.xyz>
  • Loading branch information
smtmfft and johntaiko authored May 22, 2024
1 parent cd097a5 commit 520df33
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ RUN mkdir -p \

COPY --from=builder /opt/raiko/docker/entrypoint.sh ./bin/
COPY --from=builder /opt/raiko/provers/sgx/config/sgx-guest.docker.manifest.template ./provers/sgx/config/sgx-guest.local.manifest.template
# copy to /etc/raiko, but if self register mode, the mounted one will overwrite it.
COPY --from=builder /opt/raiko/host/config/config.sgx.json /etc/raiko/
COPY --from=builder /opt/raiko/host/config/chain_spec_list_default.json /etc/raiko/chain_spec_list.docker.json
# copy to /root/.config/raiko/config/, but if self register mode, the mounted one will overwrite it.
COPY --from=builder /opt/raiko/host/config/config.sgx.json /root/.config/raiko/config/
COPY --from=builder /opt/raiko/host/config/chain_spec_list_default.json /root/.config/raiko/config/chain_spec_list.docker.json
COPY --from=builder /opt/raiko/target/release/sgx-guest ./bin/
COPY --from=builder /opt/raiko/target/release/raiko-host ./bin/
COPY --from=builder /opt/raiko/target/release/raiko-setup ./bin/
Expand Down
18 changes: 9 additions & 9 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ function bootstrap() {
function bootstrap_with_self_register() {
mkdir -p "$RAIKO_DOCKER_VOLUME_SECRETS_PATH"
cd "$RAIKO_APP_DIR"
echo "./$RAIKO_GUEST_SETUP_FILENAME bootstrap --l1-rpc $L1_RPC --l1-chain-id $L1_CHAIN_ID --sgx-verifier-address $SGX_VERIFIER_ADDRESS"
./$RAIKO_GUEST_SETUP_FILENAME bootstrap --l1-rpc $L1_RPC --l1-chain-id $L1_CHAIN_ID --sgx-verifier-address $SGX_VERIFIER_ADDRESS
echo "./$RAIKO_GUEST_SETUP_FILENAME bootstrap"
./$RAIKO_GUEST_SETUP_FILENAME bootstrap
cd -
}

Expand All @@ -44,11 +44,11 @@ function update_chain_spec_json() {
KEY_NAME=$3
UPDATE_VALUE=$4
jq \
--arg update_value "$UPDATE_VALUE" \
--arg chain_name "$CHAIN_NAME" \
--arg key_name "$KEY_NAME" \
'map(if .name == $chain_name then .[$key_name] = $update_value else . end)' $CONFIG_FILE \
> /tmp/config_tmp.json && mv /tmp/config_tmp.json $CONFIG_FILE;
--arg update_value "$UPDATE_VALUE" \
--arg chain_name "$CHAIN_NAME" \
--arg key_name "$KEY_NAME" \
'map(if .name == $chain_name then .[$key_name] = $update_value else . end)' $CONFIG_FILE \
>/tmp/config_tmp.json && mv /tmp/config_tmp.json $CONFIG_FILE
echo "Updated $CONFIG_FILE $CHAIN_NAME.$KEY_NAME=$UPDATE_VALUE"
}

Expand Down Expand Up @@ -108,8 +108,8 @@ elif [[ $# -eq 1 && $1 == "--init-self-register" ]]; then
else
echo "start proving"
if [[ ! -f "$RAIKO_DOCKER_VOLUME_PRIV_KEY_PATH" ]]; then
echo "Application was not bootstrapped. "\
"$RAIKO_DOCKER_VOLUME_PRIV_KEY_PATH is missing. Bootstrap it first." >&2
echo "Application was not bootstrapped. " \
"$RAIKO_DOCKER_VOLUME_PRIV_KEY_PATH is missing. Bootstrap it first." >&2
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion provers/sgx/setup/src/app_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub struct BootstrapArgs {
/// a proof of specified type. Curl json-rpc overrides its contents
pub config_filename: String,

#[arg(long, default_value = "chain_spec_list_default.json")]
#[arg(long, default_value = "chain_spec_list.docker.json")]
/// Path to a chain spec file that includes supported chain list
pub chain_spec_filename: String,

Expand Down
2 changes: 1 addition & 1 deletion script/publish-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ for feature in "${features[@]}"; do
fi

echo "Build and push $1:$tag..."
docker buildx build --no-cache ./ \
docker buildx build ./ \
--platform linux/amd64 \
-t raiko:$tag \
$build_flags \
Expand Down

0 comments on commit 520df33

Please sign in to comment.