-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (28 loc) · 1.23 KB
/
Dockerfile
File metadata and controls
37 lines (28 loc) · 1.23 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
FROM ghcr.io/osgeo/gdal:ubuntu-small-3.12.3
RUN apt-get update && apt-get install -y \
python3-pip \
python3-venv \
git \
curl \
&& apt-get clean \
&& rm -rf /var/lib/{apt,dpkg,cache,log}
# Install Rust via rustup (needed to build datacube-compute)
ENV CARGO_HOME="/usr/local/cargo" RUSTUP_HOME="/usr/local/rustup"
ENV PATH="$CARGO_HOME/bin:$PATH"
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
RUN pip install --break-system-packages poetry
WORKDIR /code
COPY pyproject.toml poetry.lock ./
# Install dependencies first to leverage Docker caching.
# Keep layer separate from installing the package itself to avoid re-building dependencies when our code changes.
# Make venv in-project (in container's working directory).
RUN poetry config virtualenvs.in-project true && \
poetry install --no-root
# Rust is no longer needed after dependencies are built
RUN rustup self uninstall -y && rm -rf /usr/local/cargo /usr/local/rustup
COPY . .
# Install the package itself. Keep separate from dependencies to avoid re-building dependencies when our code changes.
RUN poetry install --only-root
ENV PATH="/code/.venv/bin:$PATH"
# Smoketest
RUN ldn --help