-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add `swakny-base` image Dockerfile and a readme with instructions. - add devcontainer.json using the swanky-base image
- Loading branch information
Showing
4 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "swanky-env", | ||
"image": "ghcr.io/astarnetwork/swanky-cli/swanky-base:swanky2.2.3_v1.1.4", | ||
|
||
// Mount the workspace volume | ||
"mounts": ["source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached"], | ||
"workspaceFolder": "/workspace", | ||
|
||
"containerEnv": { | ||
"CARGO_TARGET_DIR": "/tmp" | ||
}, | ||
|
||
// Configure tool-specific properties. | ||
"customizations": { | ||
"vscode": { | ||
"extensions": ["esbenp.prettier-vscode", "dtsvet.vscode-wasm", "redhat.vscode-yaml"] | ||
} | ||
}, | ||
|
||
"remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Start from the base image | ||
FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/base:ubuntu-22.04 | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/AstarNetwork/swanky-cli | ||
|
||
# Update the package lists | ||
RUN apt-get update | ||
|
||
# Install Node.js | ||
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs | ||
|
||
# Install binaryen, pkg-config, and libssl-dev | ||
RUN apt-get install -y binaryen pkg-config libssl-dev | ||
|
||
# Download and install swanky-cli and verify the installation | ||
RUN curl -L https://github.com/AstarNetwork/swanky-cli/releases/download/v2.2.3/swanky-v2.2.3-b7052fb-linux-x64.tar.gz | tar xz -C /opt && \ | ||
ln -s /opt/swanky/bin/swanky /usr/local/bin/swanky | ||
|
||
# Install Rustup and Rust, additional components, packages, and verify the installations | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ | ||
/bin/bash -c "source $HOME/.cargo/env && \ | ||
rustup toolchain install nightly-2023-02-07 && \ | ||
rustup default nightly-2023-02-07 && \ | ||
rustup component add rust-src --toolchain nightly-2023-02-07 && \ | ||
rustup target add wasm32-unknown-unknown --toolchain nightly-2023-02-07 && \ | ||
cargo install cargo-dylint dylint-link && \ | ||
cargo install cargo-contract --force --version 2.1.0 && \ | ||
rustc --version" | ||
|
||
# Install Yarn 1.x | ||
RUN npm install -g yarn@1 | ||
|
||
# Verify installations | ||
RUN node --version && \ | ||
wasm-opt --version && \ | ||
pkg-config --version && \ | ||
openssl version && \ | ||
swanky --version && \ | ||
yarn --version | ||
|
||
# Clean up the package lists to reduce image size | ||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## Building and publishing the image | ||
|
||
### Build the image: | ||
|
||
``` | ||
docker build -t swanky-base . | ||
``` | ||
|
||
### Tag it with swanky version used, and it's own version: | ||
|
||
``` | ||
docker tag [IMAGE_NAME] ghcr.io/astarnetwork/swanky-cli/swanky-base:swanky[X.X.X]_v[X.X.X] | ||
``` | ||
|
||
Example: | ||
|
||
``` | ||
docker tag swanky-base ghcr.io/astarnetwork/swanky-cli/swanky-base:swanky2.2.2_v1.1.4 | ||
``` | ||
|
||
### Push to repo: | ||
|
||
Use the same tag created in the previous step | ||
|
||
``` | ||
docker push ghcr.io/astarnetwork/swanky-cli/swanky-base:swanky2.2.3_v1.1.4 | ||
``` |