Bug 1572019 - [RFE] ARG is not allowed to put before FROM in Dockerfile
Summary: [RFE] ARG is not allowed to put before FROM in Dockerfile
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: podman
Version: 7.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Brent Baude
QA Contact: Martin Jenner
Depends On:
Blocks: 1186913 1636853
TreeView+ depends on / blocked
Reported: 2018-04-26 01:10 UTC by Kenjiro Nakayama
Modified: 2021-06-10 15:59 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-01-31 19:21:18 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0241 0 None None None 2019-01-31 19:21:30 UTC

Description Kenjiro Nakayama 2018-04-26 01:10:10 UTC
Description of problem:

- Currently ARG is not allowed to put before FROM in Dockerfile. Please see below reproduce steps and error message.

- moby has same reports and looks like fixed it.


Version-Release number of selected component (if applicable):

- docker-1.13.1-58.git87f2fab.el7.x86_64

How reproducible: 100%

Steps to Reproduce:
1. Create Dockerfile

  # cat Dockerfile 
  ARG foo="test"
  FROM busybox
  RUN echo $foo

2. Build it

  # docker build .

Actual results:

- Getting following error

  # docker build .
  Sending build context to Docker daemon 2.048 kB
  Step 1/3 : ARG foo="test"
  Please provide a source image with `from` prior to commit

Expected results:

- Build without error.

Additional info:

- OpenShift supports specific docker version. OCP 3.9 supports docker 1.13, so we would like you to backport it into docker-1.13.

Comment 3 Daniel Walsh 2019-01-02 21:44:03 UTC
Podman build now has support for this.  Should be in podman 0.12.1

Comment 5 Joy Pu 2019-01-17 10:15:49 UTC
Test with the steps in comment 1 with podman-

# podman build -t test .
STEP 1: FROM busybox
STEP 2: RUN echo $foo
--> e6736a73421a23d68d7100ea2c42a54ce42e55e32781cc9b8a5e0bb65ed640d0
[Warning] One or more build-args [foo] were not consumed

So set this to verified.

Comment 7 errata-xmlrpc 2019-01-31 19:21:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.