Closed Aeron closed 6 months ago
I tried to build using your Dockerfile, and saw the same break. Then I removed all code from the WORKDIR that was blowing up down. I thin ran a container on the produced image and I am seeing the parent directory of the WORKDIR is a file not a directory.
$ podman run -ti test stat /usr/src/mimalloc
File: /usr/src/mimalloc
Size: 484168 Blocks: 952 IO Block: 4096 regular file
Device: 71h/113d Inode: 852856278 Links: 1
Access: (0600/-rw-------) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 1970-01-01 00:00:00.000000000 +0000
Modify: 1970-01-01 00:00:00.000000000 +0000
Change: 2024-03-03 10:08:32.179225767 +0000
Error: building at STEP "WORKDIR /usr/src/mimalloc/build": copier: mkdir: error checking directory "/usr/src/mimalloc/build": mkdir /usr/src/mimalloc/build: not a directory
is complaining because it can not create /usr/src/mimalloc/build because /usr/src/mimalloc is not a directory?
Looks like buildah treated file path as a web side rather then a git side and just downloaded the web page.
<!DOCTYPE html>
<html
lang="en"
data-color-mode="auto" data-light-theme="light" data-dark-theme="dark"
data-a11y-animated-images="system" data-a11y-link-underlines="true"
>
<head>
<meta charset="utf-8">
<link rel="dns-prefetch" href="https://github.githubassets.com">
<link rel="dns-prefetch" href="https://avatars.githubusercontent.com">
<link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com">
<link rel="dns-prefetch" href="https://user-images.githubusercontent.com/">
<link rel="preconnect" href="https://github.githubassets.com" crossorigin>
<link rel="preconnect" href="https://avatars.githubusercontent.com">
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-0eace2597ca3.css" /><lin--More-- (0% of 484153 bytes)
@flouthoc @nalind Does ADD not support Git repos in Buildah yet?
@rhatdan Buildah does support Not yet there is an open issue about it https://github.com/containers/buildah/issues/4974ADD
with source as a git repo.
Oh, I see. It was ADD
after all. So, this issue is a duplicate, kind of. I’ll close it then.
Description
Most of the issue details and a description are here. I thought I faced a Github runner problem, but it was reproducible with different OSes and versions.
The brief version is that I have a perfectly fine Dockerfile that can be built into an image by Docker. But any attempt to do it via Buildah ends up with a
mkdir: not a directory
error from theWORKDIR
directive with a nonexistent path.Yet something like the following example will build, no problem:
So, I suspect the
ADD
directive that precedes theWORKDIR
plays a role here. It has a Git source, and it creates a directory that is a part of a nonexistent directory’s path. Maybe it’s just an optimal combo.I tested it on Ubuntu 22.04 and apt-installed Buildah
1.23.1
(both VM and GitHub runner), Ubuntu 23.10 and apt-installed Buildah1.28.2
, Debian 12 and compiled Buildah1.35.0-dev
. And everything as stock as possible. The result was the same.Steps to reproduce the issue
buildah
Expected results
A build finishes without
mkdir
(or any) errors.Actual results
A build ends up with code 125 and
mkdir: not a directory
error.Outputs
The outputs below are for the Ubuntu 22.04 VM and Buildah 1.23.1 pair only because all of them are (kind of) irrelevant between OSes and versions. It looks like it’s possible to recreate anywhere.
Output of
apt list buildah
Output of
buildah version
Output of
cat /etc/*release
Output of
uname -a
Output of
cat /etc/containers/storage.conf