use-ink / cargo-contract

Setup and deployment tool for developing Wasm based smart contracts via ink!
GNU General Public License v3.0
244 stars 120 forks source link

Situation with docker image #1103

Open xermicus opened 1 year ago

xermicus commented 1 year ago

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.

cmichi commented 1 year ago

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.

ltfschoen commented 1 year ago

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 commented 1 year ago

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.