Skip to content

Commit

Permalink
Merge pull request #2004 from radixdlt/add-scrypto-dev-container
Browse files Browse the repository at this point in the history
Add scrypto dev container target
  • Loading branch information
azizi-a authored Dec 3, 2024
2 parents 0ece872 + 87e8f27 commit dec63d0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-scrypto-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
tag: ${{ needs.tags.outputs.tag }}
context: "."
dockerfile: "Dockerfile"
target: "scrypto-builder"
platforms: "linux/amd64"
provenance: "false"
scan_image: true
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-scrypto-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
tag: ${{ inputs.image-label }}
context: "."
dockerfile: "Dockerfile"
target: "scrypto-builder"
platforms: "linux/amd64"
provenance: "false"
scan_image: true
snyk_target_ref: ${{ github.ref_name }}
enable_dockerhub: true
secrets:
role_to_assume: ${{ secrets.DOCKERHUB_RELEASER_ROLE }}

19 changes: 18 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dec63d0

Please sign in to comment.