-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (38 loc) · 1.27 KB
/
Dockerfile
File metadata and controls
48 lines (38 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Dockerfile for building a Babel image.
# Let's pick up the latest Debian-based Python image.
FROM python:3.11
# Configuration options:
# - ${ROOT} is where Babel source code will be copied.
ARG ROOT=/code/babel
# - ${CORES} is the default number of cores to use.
ARG CORES=5
# Upgrade system files.
RUN apt update
RUN apt -y upgrade
# Install or upgrade some prerequisite packages.
RUN apt install -y gcc
RUN apt install -y git
# Some day we will be able to install uv directly on Debian, and then this will be redundant.
RUN apt install -y pipx
# The following packages are useful in debugging runs
# of this software on a Kubernetes cluster, but can
# be removed if not needed.
RUN apt-get install -y htop
RUN apt-get install -y screen
RUN apt-get install -y vim
RUN apt-get install -y rsync
RUN apt-get install -y jq
RUN apt-get install -y ripgrep
# Create a non-root-user.
RUN adduser --home ${ROOT} --uid 1000 nru
# Set up a $ROOT directory with the source code to work in.
RUN mkdir -p ${ROOT}
WORKDIR ${ROOT}
USER nru
COPY --chown=nru . ${ROOT}
# Install and run `uv sync` to install packages.
RUN pipx install uv
ENV PATH="${ROOT}/.local/bin:${PATH}"
RUN uv sync
# Our default entrypoint is to start the Babel run.
ENTRYPOINT ["bash", "-c", "uv run snakemake --cores ${CORES}"]