cargo-contract icon indicating copy to clipboard operation
cargo-contract copied to clipboard

Situation with docker image

Open xermicus opened this issue 2 years ago • 3 comments

Currently, the README.md pretends that instead of compiling cargo contract from sources, there is the option to use the docker image paritytech/contracts-ci-linux:production. This image doesn't exist.

There is the paritytech/contracts-ci-linux:latest image, however it contains cargo contract from whatever was in the master branch at the time the image was built. With the current latest image (sha256:dbfd21eb3b023a8cd00be74308a77b624fcc798001889247642b18a8f414e90f), it fails to build contracts created with the latest release v2.2.1:

error[E0601]: `main` function not found in crate `contract`
  --> /opt/contract/lib.rs:41:2
   |
41 | }
   |  ^ consider adding a `main` function to `/opt/contract/lib.rs`

But even if the paritytech/contracts-ci-linux:production image would exist, it'd be unclear what it actually contains. I think it'd be great if we had a dedicated cargo-contract docker image, with tags corresponding to releases.

xermicus avatar May 08 '23 10:05 xermicus

I think it'd be great if we had a dedicated cargo-contract docker image, with tags corresponding to releases. WDYT?

Could be married with https://github.com/paritytech/cargo-contract/issues/1065.

cmichi avatar May 08 '23 10:05 cmichi

for development i just created a Dockerfile at https://github.com/ltfschoen/InkTest that contains both https://github.com/paritytech/scripts/blob/master/dockerfiles/base-ci-linux/Dockerfile and https://github.com/paritytech/scripts/blob/master/dockerfiles/contracts-ci-linux/Dockerfile so i have more control, but i seem to be having a port issue https://github.com/paritytech/cargo-contract/issues/1108

ltfschoen avatar May 11 '23 02:05 ltfschoen

for development i just created a Dockerfile at https://github.com/ltfschoen/InkTest that contains both https://github.com/paritytech/scripts/blob/master/dockerfiles/base-ci-linux/Dockerfile and https://github.com/paritytech/scripts/blob/master/dockerfiles/contracts-ci-linux/Dockerfile so i have more control, but i seem to be having a port issue #1108

i resolved it by doing this https://github.com/ltfschoen/InkTest/issues/1#issuecomment-1551203393 but i'm just using docker not docker compose now. i also decided to add an optional CLI option "with_node" to conditionally install substrate-contracts-node, since it takes a long time to build that, and users on less powerful machines who are going to be deploying to a remote testnet rather than local anyway might prefer that. i've incorporated both ink! Python as well as ink! Rust.

ltfschoen avatar May 25 '23 06:05 ltfschoen