cross-rs / cross-toolchains

Additional Dockerfiles and crosstool-ng config files to build additional toolchains.
Apache License 2.0
88 stars 16 forks source link

Unable to build Docker image missing common.sh #13

Closed jshbrntt closed 1 year ago

jshbrntt commented 1 year ago
# Attempting to build the Docker image using the command provided in the README.md
jshbrntt@prophet:~/cross-toolchains$ cargo build-docker-image x86_64-pc-windows-msvc-cross --tag local
error: no such subcommand: `build-docker-image`

jshbrntt@prophet:~/cross-toolchains$ cd docker

# Attempting to build the Docker image manually using the Docker CLI
jshbrntt@prophet:~/cross-toolchains/docker$ docker build -f Dockerfile.x86_64-pc-windows-msvc-cross -t ghcr.io/cross-rs/x86_64-pc-windows-msvc-cross:local .
Sending build context to Docker daemon  81.92kB
Step 1/21 : FROM ubuntu:20.04
20.04: Pulling from library/ubuntu
fb0b3276a519: Pull complete
Digest: sha256:9c2004872a3a9fcec8cc757ad65c042de1dad4da27de4c70739a6e36402213e3
Status: Downloaded newer image for ubuntu:20.04
 ---> 817578334b4d
Step 2/21 : ARG DEBIAN_FRONTEND=noninteractive
 ---> Running in df2d9997bec1
Removing intermediate container df2d9997bec1
 ---> 7e883893d023
Step 3/21 : COPY common.sh lib.sh /
COPY failed: file not found in build context or excluded by .dockerignore: stat common.sh: file does not exist
Alexhuszagh commented 1 year ago

The build instructions highlight how to use this. We don't invoke docker build directly, and the build system requires code from cross itself.

git clone https://github.com/cross-rs/cross
cd cross
git submodule update --init --remote

Then, after you've initialized the cross-toolchains submodule within cross itself, use cross's tools to build the image:

cargo build-docker-image x86_64-pc-windows-msvc-cross

This happens because we want to share assets with those in cross/docker, which we use as Docker context (basically, the root of where Docker searches for files in). Let me know if this fixes the issue.

jshbrntt commented 1 year ago

🤦‍♂️ my bad.

Alexhuszagh commented 1 year ago

man_facepalming my bad.

No worries. Let me know if you still have issues and I'll reopen this.