jupyterhub / repo2docker

Turn repositories into Jupyter-enabled Docker images
https://repo2docker.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.63k stars 362 forks source link

a CMD provided in an appendix is ignored at run (not during build) #1374

Open itcarroll opened 1 month ago

itcarroll commented 1 month ago

Bug description

The use of CMD in an appendix is not igrnored for build but is somehow ignored for run.

Expected behaviour

$ repo2docker --appendix 'CMD ["jupyter", "lab", "--ip", "0.0.0.0", "--no-browser"]' <source-repository>

Should build and run a docker container using the command defined by CMD.

Actual behaviour

The image is built with the CMD, but still runs with the "built-in" CMD. I don't know how.

Here's the end of the build

Step 51/52 : CMD ["jupyter", "notebook", "--ip", "0.0.0.0"]
 ---> Running in e62e373bfe20
Removing intermediate container e62e373bfe20
 ---> 7b31488d3ac1
Step 52/52 : CMD ["jupyter", "lab", "--ip", "0.0.0.0", "--no-browser"]
 ---> Running in ceba06478f9a
Removing intermediate container ceba06478f9a
 ---> 7ace45a225ff

But then jupyter notebook launches. If instead I docker run 7ace45a225ff, then I get jupyter lab.

Your personal set up

Server: Docker Desktop 4.7.0 (77141) Engine: Version: 20.10.14 API version: 1.41 (minimum version 1.12) Go version: go1.16.15 Git commit: 87a90dc Built: Thu Mar 24 01:46:14 2022 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.5.11 GitCommit: 3df54a852345ae127d1fa3092b95168e4a88e2f8 runc: Version: 1.0.3 GitCommit: v1.0.3-0-gf46b6ba docker-init: Version: 0.19.0 GitCommit: de40ad0


- repo2docker version: 2024.07.0