Skip to content

factory build warning InvalidDefaultArgInFrom ARG ${BASE_IMAGE} with Docker Desktop 4.33 #1186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MikeMcC399 opened this issue Aug 7, 2024 · 6 comments · Fixed by #1187
Closed

Comments

@MikeMcC399
Copy link
Collaborator

Current behavior

When following the instructions in CONTRIBUTING > Building locally using Docker Desktop >= 4.33.0 a warning message is output:

=> WARN: InvalidDefaultArgInFrom: Default value for ARG ${BASE_IMAGE} results in empty or invalid base image name (line 4)

Desired behavior

The process to build the cypress/factory should not output any warning message when used with the current version of Docker Desktop.

Test code to reproduce

Using Docker Desktop 4.33.0 (Ubuntu) or 4.33.1 (Windows), execute:

git clone https://github.com/cypress-io/cypress-docker-images
cd cypress-docker-images/factory
docker compose build factory

Node version

v20.14.0 LTS

Operating System

Ubuntu 22.04.4 LTS / Windows 11

Debug Logs

$ docker compose build factory
[+] Building 1.3s (9/9) FINISHED                                                                                        docker:default
 => [factory internal] load build definition from factory.Dockerfile                                                              0.0s
 => => transferring dockerfile: 4.84kB                                                                                            0.0s
 => WARN: InvalidDefaultArgInFrom: Default value for ARG ${BASE_IMAGE} results in empty or invalid base image name (line 4)       0.0s
 => [factory internal] load metadata for docker.io/library/debian:12.6-slim                                                       1.1s
 => [factory internal] load .dockerignore                                                                                         0.0s
 => => transferring context: 2B                                                                                                   0.0s
 => [factory 1/3] FROM docker.io/library/debian:12.6-slim@sha256:5f7d5664eae4a192c2d2d6cb67fc3f3c7891a8722cd2903cc35aa649a12b0c8  0.0s
 => [factory internal] load build context                                                                                         0.0s
 => => transferring context: 1.14kB                                                                                               0.0s
 => CACHED [factory 2/3] RUN ls -la /root   && chmod 777 /root   && apt-get update   && apt-get install --no-install-recommends   0.0s
 => CACHED [factory 3/3] COPY ./installScripts /opt/installScripts                                                                0.0s
 => [factory] exporting to image                                                                                                  0.0s
 => => exporting layers                                                                                                           0.0s
 => => writing image sha256:64f375379bf6f6ae13fe992106cca7111ffad347fb88f5b48c0c8ac013410650                                      0.0s
 => => naming to docker.io/cypress/factory                                                                                        0.0s
 => => naming to docker.io/cypress/factory:latest                                                                                 0.0s
 => => naming to docker.io/cypress/factory:4.0.5                                                                                  0.0s
 => [factory] resolving provenance for metadata file                                                                              0.0s

Other

The release notes 4.33.0 state:

New
BuildKit now evaluates Dockerfile rules to inform you of potential issues.

@MikeMcC399

This comment was marked as outdated.

@MikeMcC399
Copy link
Collaborator Author

The explanation for this warning is in
https://docs.docker.com/reference/build-checks/invalid-default-arg-in-from/

The appearance of the warning is due to checks added to buildx v0.15.0 included in Docker Desktop 4.33.0.

The currently used CircleCI image ubuntu-2204:2024.05.1, updated through PR #1163, does not yet use this version of buildx, so there is no warning in the CircleCI jobs at this time:

Image tag Node.js Docker Engine buildx Status
ubuntu-2204:2024.05.1 20.12.2 26.0.2 v0.14.0 current

@MikeMcC399
Copy link
Collaborator Author

@Paebbels
Copy link

Paebbels commented Feb 3, 2025

That's the blog post introducing the "feature": https://www.docker.com/blog/introducing-docker-build-checks/

Here are further details: https://docs.docker.com/build/checks/

It can be disabled like this in the Dockerfile:

# check=skip=InvalidDefaultArgInFrom

@MikeMcC399
Copy link
Collaborator Author

@Paebbels

@Paebbels
Copy link

Paebbels commented Feb 3, 2025

@MikeMcC399 I added the disable syntax for other readers just for completeness. This issue is listed by Google search when searching for that problem :) So maybe it helps others running into the same trap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants