Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate if a variant build can be built inside a container #333

Open
jmt-lab opened this issue Jul 23, 2024 · 1 comment
Open

Investigate if a variant build can be built inside a container #333

jmt-lab opened this issue Jul 23, 2024 · 1 comment

Comments

@jmt-lab
Copy link
Contributor

jmt-lab commented Jul 23, 2024

A customer attempted to build bottlerocket variants inside of a docker container with the docker daemon socket shared between the host and the container. The build failed when buildsys orchestrated docker build to mount the sources into the build context because of the directory going from container volume -> host -> build-context. (bottlerocket-os/bottlerocket#4100)

We should investigate whether it would be possible for this flow to work. Roughly we could allow the user to specify a host path that is shared via a mounted volume in both the build container and then in the build context.

@jmt-lab
Copy link
Contributor Author

jmt-lab commented Jul 25, 2024

Current workaround used for this:

#!/usr/bin/env bash
git clone https://github.com/bottlerocket-os/bottlerocket.git
cd bottlerocket
BOTTLEROCKET_PATH="$(pwd)"

cat <<EOF >> build.sh
#!/usr/bin/env bash
apt update
apt install -y --no-install-recommends docker.io docker-buildx
docker image ls
apt install -y build-essential openssl libssl-dev pkg-config liblz4-tool
apt install -y rustup git curl
rustup install stable || true
cargo install cargo-make
cd "${BOTTLEROCKET_PATH}"
cargo make
EOF


docker run --rm -it -v "/tmp:/tmp" -v "/var/run/docker.sock:/var/run/docker.sock" -v "${BOTTLEROCKET_PATH}:${BOTTLEROCKET_PATH}" ubuntu sh -c "cd ${BOTTLEROCKET_PATH} && chmod +x ./build.sh && ./build.sh"

We should see if we can fix pipesys and temp sharing for sbkeys to make this better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant