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

postbuild.sh creates invalid docker-in-docker.sh #15

Open
freemansoft opened this issue Aug 4, 2024 · 1 comment
Open

postbuild.sh creates invalid docker-in-docker.sh #15

freemansoft opened this issue Aug 4, 2024 · 1 comment

Comments

@freemansoft
Copy link

freemansoft commented Aug 4, 2024

Looking at this code, I don't know what it is doing because there isn't a docker.sock in the container.

postBuild..sh directly cats code into the container to talk to /var/host-run/docker.sock. The container doesn't actually have that socket in it. This code doesn't create that

Environment

Host: Linux
Version: current version as of 2024/08/04
OS: Ubuntu
Actual socket: /var/run/docker.sock

Code

postBuild.sh

cat <<EOM \| sudo tee /etc/profile.d/docker-in-docker.sh > /dev/null
--
 if ! groups workbench \| grep docker > /dev/null; then
  docker_gid=\$(stat -c %g /var/host-run/docker.sock)
  sudo groupadd -g \$docker_gid docker
  sudo usermod -aG docker workbench
 fi

EOM

logs

stat: cannot statx '/var/host-run/docker.sock': No such file or directory
groupadd: invalid group ID 'docker'
usermod: group 'docker' does not exist
Traceback (most recent call last):
@freemansoft freemansoft changed the title postbuild.sh ignores $DOCKER_HOST postbuild.sh creates invalid docker-in-docker.sh Aug 4, 2024
@freemansoft
Copy link
Author

Note that nim anywhere appears to do something different but they do a hostmount for /var/host-run and /var/run

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