diff --git a/.github/workflows/ci-scrypto-builder.yml b/.github/workflows/ci-scrypto-builder.yml index 0cea9f5e13..9fdcd2a426 100644 --- a/.github/workflows/ci-scrypto-builder.yml +++ b/.github/workflows/ci-scrypto-builder.yml @@ -35,6 +35,7 @@ jobs: tag: ${{ needs.tags.outputs.tag }} context: "." dockerfile: "Dockerfile" + target: "scrypto-builder" platforms: "linux/amd64" provenance: "false" scan_image: true @@ -74,8 +75,7 @@ jobs: - uses: RDXWorks-actions/checkout@main - name: Pull scrypto-builder docker image - run: - DOCKER_DEFAULT_PLATFORM=linux/amd64 docker pull radixdlt/private-scrypto-builder:${{ needs.tags.outputs.tag }} + run: DOCKER_DEFAULT_PLATFORM=linux/amd64 docker pull radixdlt/private-scrypto-builder:${{ needs.tags.outputs.tag }} - name: Build scrypto example using scrypto-builder run: | cp -r examples/everything test_package diff --git a/.github/workflows/publish-scrypto-builder.yml b/.github/workflows/publish-scrypto-builder.yml index 0765fe9cdd..be3ab4695e 100644 --- a/.github/workflows/publish-scrypto-builder.yml +++ b/.github/workflows/publish-scrypto-builder.yml @@ -24,6 +24,7 @@ jobs: tag: ${{ inputs.image-label }} context: "." dockerfile: "Dockerfile" + target: "scrypto-builder" platforms: "linux/amd64" provenance: "false" scan_image: true @@ -31,4 +32,3 @@ jobs: enable_dockerhub: true secrets: role_to_assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }} - diff --git a/Dockerfile b/Dockerfile index 3dc673cf5d..b9812ddd8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,7 +50,24 @@ WORKDIR /app RUN cargo install --path ./radix-clis -FROM base-image +# This dev-container image can be built with the following command: +# docker build . --target scrypto-dev-container -t scrypto-dev-container +FROM base-image AS scrypto-dev-container +RUN apt install -y curl bash-completion git +# Install improved prompt for better dev experience - https://starship.rs/ +RUN curl -sS https://starship.rs/install.sh | sh -s -- -y +RUN echo 'eval "$(starship init bash)"\n . /etc/bash_completion' >> /root/.bashrc + +COPY --from=builder /app/target/release/scrypto /usr/local/bin/scrypto +COPY --from=builder /app/target/release/resim /usr/local/bin/resim +COPY --from=builder /app/target/release/rtmc /usr/local/bin/rtmc +COPY --from=builder /app/target/release/rtmd /usr/local/bin/rtmd +COPY --from=builder /app/target/release/scrypto-bindgen /usr/local/bin/scrypto-bindgen +RUN rustup target add wasm32-unknown-unknown +RUN rustup component add rustfmt +RUN rustup component add clippy + +FROM base-image AS scrypto-builder COPY --from=builder /app/target/release/scrypto /usr/local/bin/scrypto RUN rustup target add wasm32-unknown-unknown WORKDIR /src