-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
86 lines (63 loc) · 1.69 KB
/
Dockerfile
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# syntax = docker/dockerfile:1.4.1
from python:3.11-slim-bullseye as python-base
# <<<>>>
# Poetry
# <<<>>>
from python-base as poetry
shell ["/usr/bin/env", "bash", "-c"]
workdir /root/
run --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
<<EOF
set -o pipefail -o errexit
apt-get update
EOF
run --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
<<EOF
set -o pipefail -o errexit
apt-get install --no-install-recommends --yes \
curl \
build-essential
EOF
run --mount=type=cache,target=/root/.cache,sharing=locked \
<<EOF
set -o pipefail -o errexit
export POETRY_VERSION=1.3.2
curl \
--silent \
--show-error \
--location https://install.python-poetry.org | \
python
EOF
env PATH="/root/.local/bin:$PATH"
run poetry config virtualenvs.create false
# >>> poetry install
run python -m venv venv
copy pyproject.toml poetry.lock ./
run --mount=type=cache,target=/root/.cache,sharing=locked \
<<EOF
set -o pipefail -o errexit
source venv/bin/activate
poetry install \
--remove-untracked \
--no-root \
--no-dev \
--no-interaction
EOF
# <<<>>>
# App
# <<<>>>
from python-base as app
shell ["/usr/bin/env", "bash", "-c"]
run apt-get update && apt-get install --no-install-recommends --yes curl
run <<EOF
set -o pipefail -o errexit
curl --output objectivefs_7.2_amd64.deb https://objectivefs.com/user/download/an7dzrz65/objectivefs_7.2_amd64.deb
apt-get install --yes fuse
apt-get install --fix-broken
dpkg -i objectivefs_7.2_amd64.deb
EOF
workdir /root/
copy --from=poetry /root/venv venv
copy ./app app