From 3e8f28bd19c15fd4f3d7e8cf67f34e8784153be3 Mon Sep 17 00:00:00 2001 From: Tarek Date: Mon, 17 Jun 2024 21:52:52 +0300 Subject: [PATCH] docs: update README with Docker instructions, pin Solang image to 0.3.3 Signed-off-by: Tarek --- Makefile.toml | 7 ++++++- README.md | 8 +++++++- crates/backend/src/services/sandbox.rs | 4 ++-- sysbox/on-start.sh | 4 ++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Makefile.toml b/Makefile.toml index 56c27ac..0042e23 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -12,8 +12,13 @@ script = ''' npm install ''' +[tasks.deps-docker] +script = ''' +docker pull ghcr.io/hyperledger/solang:v0.3.3 +''' + [tasks.deps] -dependencies = ["deps-wasm", "deps-npm"] +dependencies = ["deps-wasm", "deps-npm", "deps-docker"] [tasks.build-server] script = ''' diff --git a/README.md b/README.md index 3a97f2a..9cb14f1 100644 --- a/README.md +++ b/README.md @@ -51,12 +51,18 @@ The Dockerfile for Solang Playground relies on Nestybox's Sysbox runtime. This h Here are the [instructions to install Sysbox](https://github.com/nestybox/sysbox/blob/master/docs/user-guide/install-package.md#installing-sysbox) -### Building the Docker Image +### Building the Docker Image Locally ```sh docker build -t solang-playground . ``` +You can then run the image with: + +```sh +cargo make docker-run +``` + The docker image is also available on Docker Hub: ```sh diff --git a/crates/backend/src/services/sandbox.rs b/crates/backend/src/services/sandbox.rs index 4e10489..9b53186 100644 --- a/crates/backend/src/services/sandbox.rs +++ b/crates/backend/src/services/sandbox.rs @@ -64,8 +64,8 @@ pub fn build_compile_command(input_file: &Path, output_dir: &Path) -> Command { mount_output_dir.push(DOCKER_OUTPUT); cmd.arg("--volume").arg(&mount_output_dir); - // Using the latest solang image - cmd.arg(format!("{}:latest", DOCKER_IMAGE_BASE_NAME)); + // Using the solang image version v0.3.3 + cmd.arg(format!("{}:v0.3.3", DOCKER_IMAGE_BASE_NAME)); // Building the compile command let remove_command = format!("rm -rf {}*.wasm {}*.contract", DOCKER_OUTPUT, DOCKER_OUTPUT); diff --git a/sysbox/on-start.sh b/sysbox/on-start.sh index 9fa10b6..ed62431 100755 --- a/sysbox/on-start.sh +++ b/sysbox/on-start.sh @@ -4,8 +4,8 @@ dockerd > /var/log/dockerd.log 2>&1 & sleep 2 -# pull latest solang image -docker pull ghcr.io/hyperledger/solang:latest +# pull solang image version v0.3.3 +docker pull ghcr.io/hyperledger/solang:v0.3.3 # start backend server ./app/target/release/backend --port 9000 --host 0.0.0.0 --frontend_folder /app/packages/app/dist