Skip to content

Commit 81387d3

Browse files
authored
Merge pull request #120 from GannaChernyshova/python-image-support
added python workspace
2 parents 1be71cb + a6dff4a commit 81387d3

File tree

2 files changed

+43
-2
lines changed

2 files changed

+43
-2
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM labspace-workspace-base
2+
3+
USER root
4+
RUN apt update && \
5+
apt install -y curl jq python3 python3-dev python3-pip python3-venv && \
6+
rm -rf /var/lib/apt/lists/* && \
7+
ln -sf /usr/bin/python3 /usr/bin/python && \
8+
ln -sf /usr/bin/pip3 /usr/bin/pip && \
9+
mkdir -p /home/coder/.local/share/pip && \
10+
chown -R 1000:1000 /home/coder/.local/share/pip
11+
12+
# Install Poetry using pip (more reliable than the install script)
13+
RUN pip3 install --upgrade pip setuptools wheel --break-system-packages && \
14+
pip3 install poetry --break-system-packages
15+
16+
# Install additional Python development tools
17+
RUN pip3 install black flake8 pytest pytest-cov mypy isort --break-system-packages
18+
19+
# Make poetry available system-wide
20+
RUN ln -s /usr/local/bin/poetry /usr/bin/poetry && \
21+
mkdir -p /home/coder/.local/bin && \
22+
ln -s /usr/local/bin/poetry /home/coder/.local/bin/poetry && \
23+
chown -R 1000:1000 /home/coder/.local
24+
25+
USER 1000
26+
RUN code-server --install-extension ms-python.python && \
27+
code-server --install-extension ms-python.pylint && \
28+
code-server --install-extension ms-python.black-formatter && \
29+
rm -rf /home/coder/.local/share/code-server/CachedExtensionVSIXs/.trash/*

docker-bake.hcl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ group "default" {
2323
"dd-extension",
2424
"workspace-base",
2525
"workspace-node",
26-
"workspace-java"
26+
"workspace-java",
27+
"workspace-python"
2728
]
2829
}
2930

3031
target "workspaces" {
3132
targets = [
3233
"workspace-base",
3334
"workspace-node",
34-
"workspace-java"
35+
"workspace-java",
36+
"workspace-python"
3537
]
3638
}
3739

@@ -102,6 +104,16 @@ target "workspace-java" {
102104
}
103105
}
104106

107+
target "workspace-python" {
108+
inherits = ["_common"]
109+
context = "./components/workspace/python"
110+
tags = tags(IMAGE_NAMESPACE, "labspace-workspace-python", IMAGE_TAG)
111+
112+
contexts = {
113+
labspace-workspace-base = "target:workspace-base"
114+
}
115+
}
116+
105117
target "host-port-republisher" {
106118
inherits = ["_common"]
107119
context = "./components/host-port-republisher"

0 commit comments

Comments
 (0)