containers/buildah

relative mountpoints when building should use `/` as default if no WORKDIR is provided

axel7083 opened this issue · 2 comments

Description

Related to #4309.

While testing the `Dockerfile.cpu on https://github.com/vllm-project/vllm I tried building it, and got the following error

Steps to reproduce the issue:

  1. create a Containerfile
FROM alpine:latest

RUN  --mount=type=bind,src=requirements-build.txt,target=requirements-build.txt \
    cat requirements-build.txt
  1. create a requirements-build.txt
  2. build the image
  3. assert error

We can fix the error by adding WORKDIR / before the RUN.

Describe the results you received:

$: podman build -f Dockerfile.cpu -t vllm-cpu-env --shm-size=4g .
Error: building at STEP "RUN --mount=type=cache,target=/root/.cache/pip --mount=type=bind,src=requirements-build.txt,target=requirements-build.txt pip install --upgrade pip &&     pip install -r requirements-build.txt": resolving mountpoints for container "3a97f46183fa64e10c96f20f9a38a5ed46d2e9e7c4e7bbfbce6fa1adfdacd66e": invalid container path "requirements-build.txt", must be an absolute path

Describe the results you expected:

It should probably use / as default workdir

Output of podman version if reporting a podman build issue:

podman version 5.2.2

Output of uname -a:

Linux fedora.home 6.10.8-200.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Sep  4 21:41:11 UTC 2024 x86_64 GNU/Linux

A friendly reminder that this issue had no activity for 30 days.

still valid.