RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: podman
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Brent Baude
QA Contact: Martin Jenner
URL:
Whiteboard:
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:
Environment:
Last Closed: 2019-01-31 19:21:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
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.

  https://github.com/moby/moby/issues/32457
  https://github.com/moby/moby/pull/31352

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-0.12.1.2-2.git9551f6b.el7.x86_64:

# podman build -t test .
STEP 1: FROM busybox
STEP 2: RUN echo $foo
test
--> e6736a73421a23d68d7100ea2c42a54ce42e55e32781cc9b8a5e0bb65ed640d0
STEP 3: COMMIT test
[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.

https://access.redhat.com/errata/RHBA-2019:0241


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