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

Same args with docker run command, but inconsistent behavior #3135

Closed
Pymann opened this issue May 22, 2023 · 5 comments
Closed

Same args with docker run command, but inconsistent behavior #3135

Pymann opened this issue May 22, 2023 · 5 comments

Comments

@Pymann
Copy link

Pymann commented May 22, 2023

this:

        "docker-args": {
          "stdin_open": true,
          "detach": true,
          "tty": true,
          "init": true,
          "entrypoint": "bash",
          "working_dir": "/home/docker/$(realpath --relative-to=$HOME ${pwd:exp}:exp)",
          "name": "$(CONTAINERNAME)",
          "user": "$(id -u:exp):$(id -g:exp)",
          "image": "$(DOCKER_IMAGE)",
          "cap_add": ["SYS_PTRACE"],
          "environment": ["PULSE_SERVER=unix:/tmp/pulseaudio.socket", "PULSE_COOKIE=/tmp/pulseaudio.cookie", "LM_LICENSE_FILE=1717@xxx", "MGLS_LICENSE_FILE=1717@xxx", "DISPLAY=$(DISPLAY:env)", "TERM=$(TERM:env)", "QT_X11_NO_MITSHM=1"],
          "network_mode": "host",
          "volumes": ["/tmp/pulseaudio.socket:/tmp/pulseaudio.socket", "/tmp/pulseaudio.client.conf:/etc/pulse/client.conf", "$(HOME_PATH):/home/docker", "$(CONAN_DATA_PATH):/opt/conan-user/.conan/data", "$(CONAN_DATABASE_FILE_PATH):/opt/conan-user/.conan/.conan.db", "/media/sf_C_DRIVE:/media/sf_C_DRIVE", "/tmp/.X11-unix:/tmp/.X11-unix"],
          "security_opt": ["seccomp=unconfined"]
        },

and this:
docker run --user $(id -u:exp):$(id -g:exp) -dt --cap-add=SYS_PTRACE -e PULSE_SERVER=unix:/tmp/pulseaudio.socket -e PULSE_COOKIE=/tmp/pulseaudio.cookie -v /tmp/pulseaudio.socket:/tmp/pulseaudio.socket -v /tmp/pulseaudio.client.conf:/etc/pulse/client.conf -v $(HOME_PATH):/home/docker -v $(CONAN_DATA_PATH):/opt/conan-user/.conan/data -v $(CONAN_DATABASE_FILE_PATH):/opt/conan-user/.conan/.conan.db -v /media/sf_C_DRIVE:/media/sf_C_DRIVE -e LM_LICENSE_FILE=1717@xxx -e MGLS_LICENSE_FILE=1717@xxx -e DISPLAY=$(DISPLAY:env) -e TERM=$(TERM:env) --network=host -e QT_X11_NO_MITSHM=1 -v /tmp/.X11-unix:/tmp/.X11-unix --name=$(CONTAINERNAME) --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --workdir=/home/docker/$(realpath --relative-to=$HOME ${pwd:exp}:exp) $(DOCKER_IMAGE) bash

are not doing the same. because cmake process inside container throws different errors.

@Pymann Pymann changed the title Same args with docker run command, but inconsistent behaviour Same args with docker run command, but inconsistent behavior May 22, 2023
@Pymann
Copy link
Author

Pymann commented Jun 2, 2023

with docker inspect I found out, that the entrypoint differs and fixed it. But still the volumes list is not doing same the -v option does.

@milas
Copy link
Contributor

milas commented Jun 2, 2023

At a quick glance, your Python invocation appears to be using shell/environment variables, e.g. $(CONAN_DATA_PATH). Those are going to be passed through literally.

Beyond that, there's not really much to go on here or indication that this is a bug in the library. If you can create a repro case with steps, feel free to open a new issue.

@milas milas closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2023
@Pymann
Copy link
Author

Pymann commented Jun 2, 2023

The $() is consumed and replaced by a custom parser:
{'detach': True, 'tty': True, 'init': True, 'entrypoint': ['fixuid', '-q', 'bash'], 'working_dir': '/home/docker/xxx', 'name': 'SEAV1-devenv-54_2_0-1-py', 'user': '1553512:1000513', 'image': 'xxx', 'cap_add': ['SYS_PTRACE'], 'environment': ['PULSE_SERVER=unix:/tmp/pulseaudio.socket', 'PULSE_COOKIE=/tmp/pulseaudio.cookie', 'LM_LICENSE_FILE=1717@xxxm', 'MGLS_LICENSE_FILE=1717@xxxxx', 'DISPLAY=:0', 'TERM=xterm-256color', 'QT_X11_NO_MITSHM=1'], 'network_mode': 'host', 'volumes': ['/tmp/pulseaudio.socket:/tmp/pulseaudio.socket', '/tmp/pulseaudio.client.conf:/etc/pulse/client.conf', '/home/EU.BSHG.COM/ehrhardtn:/home/docker', '/home/EU.BSHG.COM/ehrhardtn/.conan/data:/opt/conan-user/.conan/data', '/home/EU.BSHG.COM/ehrhardtn/.conan/.conan.db:/opt/conan-user/.conan/.conan.db', '/media/sf_C_DRIVE:/media/sf_C_DRIVE', '/tmp/.X11-unix:/tmp/.X11-unix'], 'security_opt': ['seccomp=unconfined'], 'mounts': []}

@Pymann
Copy link
Author

Pymann commented Jun 2, 2023

I docker inspect and have two different containers, respecting the mount options:
the volumes differ, therefore there is bug in library, producing inconsistency in comparison to the docker run command:

argument:
'volumes': ['/tmp/pulseaudio.socket:/tmp/pulseaudio.socket', '/tmp/pulseaudio.client.conf:/etc/pulse/client.conf', '/home/EU.BSHG.COM/ehrhardtn:/home/docker', '/home/EU.BSHG.COM/ehrhardtn/.conan/data:/opt/conan-user/.conan/data', '/home/EU.BSHG.COM/ehrhardtn/.conan/.conan.db:/opt/conan-user/.conan/.conan.db', '/media/sf_C_DRIVE:/media/sf_C_DRIVE', '/tmp/.X11-unix:/tmp/.X11-unix']

and -v option with same content dont do same.

Again its visible with docker inspect:
volumes stays null for a normal docker run, but is filled by docker-py package.
It can cause conan to end in --locked errors.

@Pymann
Copy link
Author

Pymann commented Jun 2, 2023

docker-py:
"Volumes": {
"/etc/pulse/client.conf": {},
"/home/docker": {},
"/media/sf_C_DRIVE": {},
"/opt/conan-user/.conan/.conan.db": {},
"/opt/conan-user/.conan/data": {},
"/tmp/.X11-unix": {},
"/tmp/pulseaudio.socket": {}
},

docker run
"Volumes": null,

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

No branches or pull requests

2 participants