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

Update Dockerfile and docs to use CMD instead of ENTRYPOINT #641

Merged
merged 3 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions analyses/cell-type-ewings/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ RUN Rscript -e 'renv::restore()' && \
rm -rf /tmp/downloaded_packages && \
rm -rf /tmp/Rtmp*

# Set entrypoint to bash to activate the environment for any commands
ENTRYPOINT ["/bin/bash"]
# Set CMD to bash to activate the environment for any commands
CMD ["/bin/bash"]
1 change: 1 addition & 0 deletions analyses/doublet-detection/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ RUN Rscript -e 'renv::restore()' \
# Activate conda environment on bash launch
RUN echo "conda activate ${ENV_NAME}" >> ~/.bashrc

# Set CMD to bash to activate the environment when launching
CMD ["/bin/bash"]
4 changes: 2 additions & 2 deletions analyses/hello-python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ RUN conda-lock install -n ${ENV_NAME} && \
# Activate conda environment on bash launch
RUN echo "conda activate ${ENV_NAME}" >> ~/.bashrc

# Set entrypoint to bash to activate the environment for any commands
ENTRYPOINT ["bash", "-l"]
# Set CMD to bash to activate the environment when launching
CMD ["/bin/bash"]
10 changes: 5 additions & 5 deletions docs/ensuring-repro/docker/docker-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ In the Dockerfile, you will want include the following steps:
- Install `conda-lock`.
- Copy the `conda-lock.yml` file from the host environment to the image.
- Use `conda-lock install` to create an environment from the `conda-lock.yml` file.
- Make sure the environment is activated when the container is launched by modifying the `.bashrc` file and setting the `ENTRYPOINT` to `bash -l -c`.
- Make sure the environment is activated when the container is launched by modifying the `.bashrc` file and setting the `CMD` to `/bin/bash`.

A simple `Dockerfile` for a conda-based analysis module that uses `conda-lock` for its environment might look like this:

Expand All @@ -127,8 +127,8 @@ RUN conda-lock install -n ${ENV_NAME} \
# Activate conda environment on bash launch
RUN echo "conda activate ${ENV_NAME}" >> ~/.bashrc

# Set entrypoint to bash to activate the environment for any commands
ENTRYPOINT ["bash", "-l", "-c"]
# Set CMD to bash to activate the environment when launching
CMD ["/bin/bash"]
```


Expand Down Expand Up @@ -188,8 +188,8 @@ RUN Rscript -e 'renv::restore()' \
# Activate conda environment on bash launch
RUN echo "conda activate ${ENV_NAME}" >> ~/.bashrc

# Set entrypoint to bash to activate the environment for any commands
ENTRYPOINT ["bash", "-l", "-c"]
# Set CMD to bash to activate the environment when launching
CMD ["/bin/bash"]
```

!!! tip
Expand Down