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

CMD/ENTRYPOINT behaviour inconsistent with docker #485

Closed
mackworthy opened this issue Feb 11, 2023 · 1 comment · Fixed by #525
Closed

CMD/ENTRYPOINT behaviour inconsistent with docker #485

mackworthy opened this issue Feb 11, 2023 · 1 comment · Fixed by #525
Labels

Comments

@mackworthy
Copy link

Given the following Dockerfile:

FROM ubuntu:22.10
CMD echo "hello world"

I get the following output when running with docker directly:
docker build -t testcontainer . && docker run -it --rm testcontainer

Sending build context to Docker daemon  3.072kB
Step 1/2 : FROM ubuntu:22.10
 ---> 10c2f4041af1
Step 2/2 : CMD echo "hello world"
 ---> Running in e369a1c52113
Removing intermediate container e369a1c52113
 ---> 468dba470e32
Successfully built 468dba470e32
Successfully tagged testcontainer:latest
hello world

However, running with x11docker yields an error, instead of correctly returning "hello world" as docker did:
x11docker testcontainer

x11docker WARNING: User mackworthy is member of group docker.
  That allows unprivileged processes on host to gain root privileges.

x11docker note: Option --xc for X in container enabled automatically.

x11docker note: Using X server option --nxagent

x11docker note: A few applications do not work well with --nxagent.
  In that case, you can try to fix the issue with option --composite
  or try another X server option like --xpra (seamless) or --xephyr (windowed).

x11docker note: Option --network=none is set to disable network access.
  If you need network and internet access, set option -I, --network [=NET].

/x11docker/cmdrc: 91: -c: not found
/x11docker/cmdrc: 92: echo "hello world": not found
/x11docker/cmdrc: 96: /bin/sh
-c
echo: not found

An error occurs whether you use CMD or ENTRYPOINT, with Shell form or Exec form.

FROM ubuntu:22.10
CMD ["echo", "hello world"]

docker build -t testcontainer . && docker run -it --rm testcontainer

Sending build context to Docker daemon  3.072kB
Step 1/2 : FROM ubuntu:22.10
 ---> 10c2f4041af1
Step 2/2 : CMD ["echo", "hello world"]
 ---> Running in e127ad651103
Removing intermediate container e127ad651103
 ---> 93b227d84b03
Successfully built 93b227d84b03
Successfully tagged testcontainer:latest
hello world

x11docker testcontainer

x11docker WARNING: User mackworthy is member of group docker.
  That allows unprivileged processes on host to gain root privileges.

x11docker note: Option --xc for X in container enabled automatically.

x11docker note: Using X server option --nxagent

x11docker note: A few applications do not work well with --nxagent.
  In that case, you can try to fix the issue with option --composite
  or try another X server option like --xpra (seamless) or --xephyr (windowed).

x11docker note: Option --network=none is set to disable network access.
  If you need network and internet access, set option -I, --network [=NET].

/x11docker/cmdrc: 91: hello world: not found
/x11docker/cmdrc: 94: echo
hello: not found

My environment:

  • x11docker v7.6.0 on Manjaro via AUR
  • Docker version 20.10.23, build 715524332f
@mviereck mviereck added the bug label Feb 15, 2023
@mviereck
Copy link
Owner

Thank you for the report!
I'll have a look, might take some time.

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

Successfully merging a pull request may close this issue.

2 participants