|
1 | 1 | FROM nextstrain/base:latest |
2 | 2 |
|
| 3 | +# Run the final setup as our target user for permissions reasons. |
| 4 | +USER nextstrain:nextstrain |
| 5 | + |
3 | 6 | # Install Miniforge (includes conda) |
4 | | -# FIXME: check permissions |
5 | 7 | RUN curl -L "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-$(uname -m).sh" -o miniforge.sh && \ |
6 | 8 | bash miniforge.sh -b -p /nextstrain/miniforge && \ |
7 | | - rm miniforge.sh && \ |
8 | | - chmod -R 777 /nextstrain/miniforge |
| 9 | + rm miniforge.sh |
9 | 10 |
|
10 | 11 | # Make conda available in PATH |
11 | 12 | ENV PATH="/nextstrain/miniforge/bin:$PATH" |
12 | 13 |
|
13 | 14 | # Initialize conda for interactive shell use |
14 | 15 | RUN conda init bash |
15 | 16 |
|
16 | | -# FIXME: is `umask 000` ok to use here? |
17 | | - |
18 | 17 | # Create conda environments |
19 | | -COPY envs/csvtk.yaml /tmp/ |
20 | | -RUN umask 000 && conda env create --name csvtk --file /tmp/csvtk.yaml && rm /tmp/csvtk.yaml |
21 | | - |
22 | | -COPY envs/nextstrain.yaml /tmp/ |
23 | | -RUN umask 000 && conda env create --name nextstrain --file /tmp/nextstrain.yaml && rm /tmp/nextstrain.yaml |
24 | | - |
25 | 18 | COPY envs/snippy.yaml /tmp/ |
26 | | -RUN umask 000 && conda env create --name snippy --file /tmp/snippy.yaml && rm /tmp/snippy.yaml |
| 19 | +RUN conda env create --name snippy --file /tmp/snippy.yaml && rm /tmp/snippy.yaml |
27 | 20 |
|
28 | 21 | COPY envs/tb-profiler.yaml /tmp/ |
29 | | -RUN umask 000 && conda env create --name tb-profiler --file /tmp/tb-profiler.yaml && rm /tmp/tb-profiler.yaml |
| 22 | +RUN conda env create --name tb-profiler --file /tmp/tb-profiler.yaml && rm /tmp/tb-profiler.yaml |
30 | 23 |
|
31 | | -COPY envs/tsv-utils.yaml /tmp/ |
32 | | -RUN umask 000 && conda env create --name tsv-utils --file /tmp/tsv-utils.yaml && rm /tmp/tsv-utils.yaml |
| 24 | +# Switch back to root. The entrypoint will drop to nextstrain:nextstrain as |
| 25 | +# necessary when a container starts. |
| 26 | +USER root |
0 commit comments