Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions Dockerfile.layer2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FROM ${BASE_IMAGE}
# Container version labels
LABEL layer="2"
LABEL layer.name="frappe-bench"
LABEL layer.version="2.1.1"
LABEL layer.version="2.1.3"
LABEL layer.updated="2026-03-07"
Comment on lines +12 to 13
LABEL layer.description="Frappe development and diagnostic tools"
LABEL bench.type="frappe"
Expand Down Expand Up @@ -60,12 +60,7 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# DOCKER CLI (daemon runs on host via mounted socket)
# ========================================

RUN curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-27.5.1.tgz \
| tar xz --strip-components=1 -C /usr/local/bin docker/docker \
&& mkdir -p /usr/local/lib/docker/cli-plugins \
&& curl -fsSL -o /usr/local/lib/docker/cli-plugins/docker-compose \
https://github.com/docker/compose/releases/download/v2.34.0/docker-compose-linux-x86_64 \
&& chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
RUN docker --version && docker compose version

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Install the Docker client instead of only checking it

When this repo is built against the documented dev-bench-base:latest Layer 1a that does not already provide Docker Compose, this replaces the only Layer 2 Docker client installation with a version check. The devcontainer bind-mounts /var/run/docker.sock, but that mount does not provide the docker or Compose binaries, so bases without those tools now fail at this RUN step instead of producing the Frappe image.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Install Docker CLI before checking it

When building against the documented dev-bench-base layer, Docker is no longer installed by this Dockerfile before this RUN executes. The previous block downloaded both the Docker client and Compose plugin here, but this change only verifies inherited tools, so builds fail at this layer with docker: not found unless an out-of-repo base image has been rebuilt with Docker already included.

Useful? React with 👍 / 👎.


# ========================================
# PYTHON DIAGNOSTIC TOOLS
Expand All @@ -75,12 +70,21 @@ RUN curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-27.
RUN pip3 install --break-system-packages \
py-spy \
web-pdb \
frappe-bench \
ruff \
pre-commit \
coverage \
pytest-cov \
&& pip3 cache purge
'click~=8.2.0' \
'gitpython~=3.1.30' \
honcho \
'jinja2~=3.1.3' \
'python-crontab~=2.6.0' \
'requests~=2.33.0' \
'setuptools>=71.0.0,<82.0.0' \
&& pip3 install --break-system-packages --no-deps frappe-bench \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Install semantic-version with bench

Because this image now installs frappe-bench with --no-deps, every runtime dependency has to be listed explicitly. The added list omits semantic-version, which current bench imports from bench.app; the later bench get-app commands in this same Dockerfile load that module, so the Layer 2 build will fail with ModuleNotFoundError: No module named 'semantic_version' before the template apps are fetched.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Install semantic-version before bench get-app

In a clean Layer 1a image that does not already have semantic-version, installing frappe-bench with --no-deps skips one of bench's declared runtime dependencies. The template build later runs bench get-app, which imports bench.app and then semantic_version, so the Docker build fails with ModuleNotFoundError before the image can be produced. Either let pip resolve bench dependencies or install semantic-version explicitly here.

Useful? React with 👍 / 👎.

&& pip3 cache purge \
Comment on lines +83 to +85
&& uv --version \
&& bench --version

# ========================================
# NODE.JS VERSION PIN (Frappe requires Node 18 or 20)
Expand Down