From c1b5abd94088cd3fe3ec75c57011fd64ca1a9328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Alejandro=20Guti=C3=A9rrez?= <33366442+CAGS295@users.noreply.github.com> Date: Wed, 18 Oct 2023 06:33:36 -0600 Subject: [PATCH] Reintroduce alpine to the sbtc service. (#298) * don't build in `up.sh` * reintroduce alpine --- devenv/sbtc/docker/Dockerfile | 15 ++++++--------- devenv/sbtc/docker/entrypoint | 2 +- devenv/up.sh | 3 +-- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/devenv/sbtc/docker/Dockerfile b/devenv/sbtc/docker/Dockerfile index 0318170c..81449b6c 100644 --- a/devenv/sbtc/docker/Dockerfile +++ b/devenv/sbtc/docker/Dockerfile @@ -1,14 +1,12 @@ -FROM rust:bookworm as clarinet +FROM rust:alpine as clarinet -RUN apt update && apt install -y pkg-config libssl-dev clang && \ - rm -rf /var/lib/apt/lists/* +RUN apk add --no-cache g++ musl-dev git openssl-dev clang-dev RUN cargo install clarinet-cli --bin clarinet --branch develop --locked --git https://github.com/hirosystems/clarinet.git -FROM rust:bookworm as romeo +FROM rust:alpine as romeo -RUN apt update && apt install -y g++ libssl-dev clang libsecp256k1-dev && \ - rm -rf /var/lib/apt/lists/* +RUN apk add --no-cache g++ musl-dev git openssl-dev clang-dev libsecp256k1-dev RUN cargo install --locked cargo-make @@ -19,10 +17,9 @@ ENV RUSTFLAGS "-C target-feature=-crt-static" RUN cargo install --locked --path sbtc-cli RUN cargo install --locked --path romeo -FROM rust:slim-bookworm +FROM alpine:latest -RUN apt update && apt install -y openssl libsecp256k1-dev curl jq && \ - rm -rf /var/lib/apt/lists/* +RUN apk add --no-cache g++ openssl libsecp256k1 curl jq COPY --from=clarinet /usr/local/cargo/bin/clarinet /usr/local/bin COPY --from=romeo /usr/local/cargo/bin/sbtc /usr/local/bin diff --git a/devenv/sbtc/docker/entrypoint b/devenv/sbtc/docker/entrypoint index 9cb9ec23..6c9c96d7 100644 --- a/devenv/sbtc/docker/entrypoint +++ b/devenv/sbtc/docker/entrypoint @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh set -euo >/dev/null diff --git a/devenv/up.sh b/devenv/up.sh index 831e8a6e..ba87fb47 100755 --- a/devenv/up.sh +++ b/devenv/up.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash -if [ $? -eq 0 ] -then +if [ $? -eq 0 ]; then docker compose up -d else echo "Build failed, not starting devenv"