From 98633652e78138421036f008fb5d0504261f545e Mon Sep 17 00:00:00 2001 From: Azizi <64193693+azizi-a@users.noreply.github.com> Date: Fri, 15 Nov 2024 16:05:00 +0000 Subject: [PATCH 1/6] feat: add dev-container target to docker file --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index 3dc673cf5d..2938e8a7fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,6 +50,13 @@ WORKDIR /app RUN cargo install --path ./radix-clis +FROM base-image as dev-container +RUN apt install -y bash-completion powerline +RUN echo 'powerline-daemon -q; POWERLINE_BASH_CONTINUATION=1; POWERLINE_BASH_SELECT=1; . /usr/share/powerline/bindings/bash/powerline.sh; . /etc/bash_completion' >> ~/.bashrc +COPY --from=builder /app/target/release/scrypto /usr/local/bin/scrypto +COPY --from=builder /app/target/release/resim /usr/local/bin/resim +RUN rustup target add wasm32-unknown-unknown + FROM base-image COPY --from=builder /app/target/release/scrypto /usr/local/bin/scrypto RUN rustup target add wasm32-unknown-unknown From c0d74bfe4a929a3a79ba338d641673f92ed7ccf6 Mon Sep 17 00:00:00 2001 From: Azizi <64193693+azizi-a@users.noreply.github.com> Date: Thu, 21 Nov 2024 21:54:08 +0000 Subject: [PATCH 2/6] tweak: add packages to dev-container --- Dockerfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2938e8a7fd..d01ce2858e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,11 +50,17 @@ WORKDIR /app RUN cargo install --path ./radix-clis -FROM base-image as dev-container +# 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 +# Install improved prompt powerline and bash-completion RUN apt install -y bash-completion powerline RUN echo 'powerline-daemon -q; POWERLINE_BASH_CONTINUATION=1; POWERLINE_BASH_SELECT=1; . /usr/share/powerline/bindings/bash/powerline.sh; . /etc/bash_completion' >> ~/.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 RUN rustup target add wasm32-unknown-unknown FROM base-image From b77cf53b7224fa4d8efdc790cf60bf3ea128b817 Mon Sep 17 00:00:00 2001 From: Azizi <64193693+azizi-a@users.noreply.github.com> Date: Thu, 21 Nov 2024 21:55:47 +0000 Subject: [PATCH 3/6] tweak: name scrypto-builder docker file target --- .github/workflows/ci-scrypto-builder.yml | 4 ++-- .github/workflows/publish-scrypto-builder.yml | 2 +- Dockerfile | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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 d01ce2858e..e1458ce6ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,7 +63,7 @@ COPY --from=builder /app/target/release/rtmc /usr/local/bin/rtmc COPY --from=builder /app/target/release/rtmd /usr/local/bin/rtmd RUN rustup target add wasm32-unknown-unknown -FROM base-image +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 From 1b3d0ca1520f6ea5329d87f95b4346fe4cf34365 Mon Sep 17 00:00:00 2001 From: Azizi <64193693+azizi-a@users.noreply.github.com> Date: Fri, 22 Nov 2024 11:02:28 +0000 Subject: [PATCH 4/6] tweak: add git to scrypto-dev-container --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e1458ce6ff..7d135956a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,14 +53,15 @@ RUN cargo install --path ./radix-clis # 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 -# Install improved prompt powerline and bash-completion -RUN apt install -y bash-completion powerline -RUN echo 'powerline-daemon -q; POWERLINE_BASH_CONTINUATION=1; POWERLINE_BASH_SELECT=1; . /usr/share/powerline/bindings/bash/powerline.sh; . /etc/bash_completion' >> ~/.bashrc +# Install improved prompt powerline, bash-completion and git +RUN apt install -y powerline bash-completion git +RUN echo 'powerline-daemon -q; POWERLINE_BASH_CONTINUATION=1; POWERLINE_BASH_SELECT=1; . /usr/share/powerline/bindings/bash/powerline.sh; . /etc/bash_completion;' >> ~/.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 FROM base-image AS scrypto-builder From cb560a52b687c5f7688583c993767a171786c2d2 Mon Sep 17 00:00:00 2001 From: Azizi <64193693+azizi-a@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:08:13 +0000 Subject: [PATCH 5/6] tweak: add rustfmt and update prompt in scrypto-dev-container --- Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7d135956a7..d8c3004cbc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,9 +53,10 @@ RUN cargo install --path ./radix-clis # 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 -# Install improved prompt powerline, bash-completion and git -RUN apt install -y powerline bash-completion git -RUN echo 'powerline-daemon -q; POWERLINE_BASH_CONTINUATION=1; POWERLINE_BASH_SELECT=1; . /usr/share/powerline/bindings/bash/powerline.sh; . /etc/bash_completion;' >> ~/.bashrc +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 @@ -63,6 +64,7 @@ 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 FROM base-image AS scrypto-builder COPY --from=builder /app/target/release/scrypto /usr/local/bin/scrypto From 87e8f2754f8b7c40c10a2f78a0d8f2794fe36ca3 Mon Sep 17 00:00:00 2001 From: Azizi <64193693+azizi-a@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:17:43 +0000 Subject: [PATCH 6/6] tweak: add clippy to scrypto-dev-container --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index d8c3004cbc..b9812ddd8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -65,6 +65,7 @@ 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