Bug 1730446 - Imagebuilder - Copying files in between stages is unexpectedly failing [NEEDINFO]
Summary: Imagebuilder - Copying files in between stages is unexpectedly failing
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker
Version: 7.7
Hardware: All
OS: Unspecified
Target Milestone: rc
: 7.8
Assignee: Nalin Dahyabhai
QA Contact: atomic-bugs@redhat.com
Depends On:
Blocks: 1186913
TreeView+ depends on / blocked
Reported: 2019-07-16 18:08 UTC by Rogerio Bastos
Modified: 2020-09-14 14:28 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2020-06-10 09:32:29 UTC
Target Upstream Version:
tsweeney: needinfo? (nalin)

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github openshift imagebuilder pull 134 0 'None' closed [openshift-3.11] Bug 1730446: dockerclient newArchiveMapper: always end archiveRoot with "/" 2020-09-14 14:25:45 UTC
Github openshift origin pull 23562 0 'None' closed [release-3.11] Bug 1730446: bump(github.com/openshift/imagebuilder) 2020-09-14 14:25:45 UTC

Description Rogerio Bastos 2019-07-16 18:08:20 UTC
Description of problem:

When running imagebuilder with the following sample Dockerfile, copying a file in between stages is failing silently.

How reproducible: Always

Steps to Reproduce:
Run imagebuilder with the sample Dockerfile:

FROM openshift/origin-cli:v3.11 AS builder
RUN ls -l /bin/oc
# Multistage with python
FROM python:2.7.15 AS runner

# Bring oc binary to python image
COPY --from=builder /bin/oc /bin/

RUN ls -l /bin/oc

Actual results:
--> FROM openshift/origin-cli:v3.11 as builder
--> RUN ls -l /bin/oc
-rwxr-xr-x. 1 root root 120627192 Jul  5 15:09 /bin/oc
--> FROM python:2.7.15 as runner
--> COPY --from=builder /bin/oc /bin/
--> RUN ls -l /bin/oc
ls: cannot access '/bin/oc': No such file or directory
running 'ls -l /bin/oc' failed with exit code 2

Expected results:
The oc binary should be copied to the second stage

Additional info:
$ imagebuilder --version

Comment 1 Ben Parees 2019-07-16 18:13:19 UTC
Note that the following dockerfile does work:

FROM openshift/origin-cli:v3.11 AS builder

RUN cp /bin/oc /

# Multistage with python
FROM python:2.7.15 AS runner

# Bring oc binary to python image
COPY --from=builder /oc /bin/

So copying the file into a new layer in the stage 0 image, makes it available to COPY --from in stage 1.

The main implication of this is it breaks ocp 3.11 multistage builds (which rely on imagebuilder under the covers).

Comment 2 Ben Parees 2019-07-16 18:14:36 UTC
this can be reproduced using the imagebuilder CLI tool.

Comment 3 Daniel Walsh 2019-07-17 09:48:12 UTC
I take it that this is not an issue with Buildah running the build but with the Docker.sock since this is openshift 3.11?

So not sure why this is assigned to Nalin?

Comment 4 Ben Parees 2019-07-17 14:16:30 UTC
It's not a buildah issue, it is an imagebuilder issue (it occurs both when running imagebuilder on the cli, as well as in OCP3.11 when builds use imagebuilder to build multistage dockerfiles).

Since the containers team owns imagebuilder(right?), it was assigned to that component... not sure who within the team is the right assignee.

Comment 5 Daniel Walsh 2019-07-17 21:10:54 UTC
Ok, We can leave it with Nalin for now, but I will add Tom as well.

Comment 8 Nalin Dahyabhai 2019-08-06 14:45:05 UTC
I mistakenly linked this bug to the PR against the master branch, and not the 3.11 branch.

Comment 9 Nalin Dahyabhai 2019-08-06 17:59:30 UTC
Moving back to assigned for the final PR to get this into origin's 3.11 branch.

Comment 22 Tom Sweeney 2020-06-09 20:51:42 UTC
Nalin's PR (https://github.com/openshift/origin/pull/23562) was closed in December of 2019.  Nalin/Jindrich can we close this now?  I don't believe there's any further packaging needs for this at this time.

Comment 23 Jindrich Novy 2020-06-10 09:32:29 UTC
Assuming this is now part of openshift/origin and no longer an issue. If it is, please reopen.

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