I'm trying to setup a local build environment for Solidity on Windows (10).

One of the options recommended in the Solidity docs is docker.

Superficially, the docker image runs fine:

C:\work\eth>docker run ethereum/solc:stable --version
solc, the solidity compiler commandline interface
Version: 0.4.11+commit.68ef5810.Linux.g++

But, it's not managing to access any files

C:\work\eth>docker run ethereum/solc:stable Coin.sol
Skipping non-existent input file ""Coin.sol""

C:\work\eth>dir Coin.sol

 Directory of C:\work\eth

05/22/2017  02:55 PM               873 Coin.sol
               1 File(s)            873 bytes
               0 Dir(s)  263,229,722,624 bytes free

Is this a docker issue? An issue with the solc image? How should I proceed?

  • I have the same issue trying to execute solc from a maven plugin within Jenkins. May 28 '17 at 9:11

Docker isn't aware of your local file system by default.
You need to bind your local directory as a data volume. (https://docs.docker.com/engine/tutorials/dockervolumes/#mount-a-host-directory-as-a-data-volume)

In your case, I believe the command you're looking for is:

docker run -v c:\work\eth:c:\solidity ethereum/solc:stable Coin.sol

If you want to check if docker can see your local file, these two commands should help:

docker run --entrypoint /bin/pwd -v c:\work\eth:c:\solidity ethereum/solc:stable

docker run --entrypoint /bin/ls -v c:\work\eth:c:\solidity ethereum/solc:stable

(I'm not a windows user and have not tested these on windows)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.