Skip to content

Commit

Permalink
Merge pull request #641 from jashapiro/jashapiro/no-entry
Browse files Browse the repository at this point in the history
Update Dockerfile and docs to use CMD instead of ENTRYPOINT
  • Loading branch information
jashapiro authored Jul 23, 2024
2 parents b19db32 + 3acd7c8 commit 23a4540
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
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

0 comments on commit 23a4540

Please sign in to comment.