Skip to content

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

@freemansoft

Description

@freemansoft

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):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions