#Dockerfile ADD --unpack - unkown flag

1 messages · Page 1 of 1 (latest)

hardy charm
#

Just saw this and wanted to bring up that this might ba missing bit for Dockerfile support

on dagger v0.20.3 (image://registry.dagger.io/engine:v0.20.3) darwin/arm64/v8

A Dockerfile with
ADD --unpack https://go.dev/dl/go${GO_VERSION}.${BUILDOS}-${BUILDARCH}.tar.gz /usr/local

with sourceDir.dockerBuild(...) I get
dockerfile parse error on line 12: unknown flag: unpack

balmy bolt
weak forge
#

Yes, --unpack is one of the newer dockerfile features and we probably just forgot to update

weak forge
weak forge
#

You can also already try it:

dagger -m github.com/tiborvass/dagger@dockerfile-unpack -c 'engine-dev | load-to-docker $(host | unix-socket /var/run/docker.sock) --name dagger-engine-unpack' && _EXPERIMENTAL_DAGGER_RUNNER_HOST=docker-image://dagger-engine-unpack DAGGER_LEAVE_OLD_ENGINE=1 dagger core version
weak forge
hardy charm
#

@weak forge Actually, I would have expected the same, but to my surprise (indepentenly from dagger): with the following dockerfile step (and Docker version 29.1.4-rd, build 3c6914c - this is rancher desktop)

ADD https://github.com/gi8lino/vex/releases/download/v0.0.5/vex_0.0.5_${TARGETOS}_${TARGETARCH}.tar.gz /opt/
RUN ls -al /opt &&  false

and
docker build ...

I get

 > [4/7] RUN ls -al /opt &&  false:
0.301 total 928
0.301 drwxr-xr-x 1 root root   4096 Mar 25 08:00 .
0.301 drwxr-xr-x 1 root root   4096 Mar 25 08:07 ..
0.301 drwxr-xr-x 7 root root   4096 Mar 24  2025 bitnami
0.301 -rw------- 1 root root 937929 Sep 11  2025 vex_0.0.5_linux_amd64.tar.gz

and running

ADD --unpack https://github.com/gi8lino/vex/releases/download/v0.0.5/vex_0.0.5_${TARGETOS}_${TARGETARCH}.tar.gz /opt/

gives me

 > [4/7] RUN ls -al /opt &&  false:
0.300 total 2116
0.300 drwxr-xr-x 1 root root    4096 Mar 25 08:00 .
0.300 drwxr-xr-x 1 root root    4096 Mar 25 08:05 ..
0.300 -rw-r--r-- 1 1001 1001   11353 Sep 11  2025 LICENSE
0.300 -rw-r--r-- 1 1001 1001    7084 Sep 11  2025 README.md
0.300 drwxr-xr-x 7 root root    4096 Mar 24  2025 bitnami
0.300 -rwxr-xr-x 1 1001 1001 2130104 Sep 11  2025 vex
restive zenith
#

If remote file is a tar archive, the archive is not extracted by default. To download and extract the archive, use the [ADD --unpack flag].