containers / buildah

A tool that facilitates building OCI images.
https://buildah.io
Apache License 2.0
7.49k stars 785 forks source link

buildah COPY directory incompatible with docker #1557

Closed jkryl closed 5 years ago

jkryl commented 5 years ago

I have following docker file:

FROM node:10

RUN mkdir /moac
WORKDIR /moac
COPY moac/package*.json ./
RUN npm install
COPY moac /moac/
RUN mkdir -p /mayastor-grpc/proto
COPY mayastor-grpc/proto /mayastor-grpc/proto

ENTRYPOINT ["/moac/main.js"]

it works fine with docker. However when using buildah the following line causes problem:

COPY moac /moac/

Instead of taking content of "moac" directory and putting it to /moac dir, it takes the moac directory itself. So for example:

/moac/main.js

becomes

/moac/moac/main.js

This happens with buildah 1.8-dev version on Ubuntu 18.04.

Version:         1.8-dev
Go Version:      go1.10.4
Image Spec:      1.0.0
Runtime Spec:    1.0.0
CNI Spec:        0.4.0
libcni Version:
Git Commit:
Built:           Wed Apr 17 23:17:46 2019
OS/Arch:         linux/amd64

I think this is a regression as I don't remember to see this behaviour with older version, though I'm not sure about it.

rhatdan commented 5 years ago

@TomSweeneyRedHat Could you verify this. Since you have been in this code lately.

TomSweeneyRedHat commented 5 years ago

@jkryl I think this may have been resolved just last night with #1443. Is there any way you can pull/build from upstream and try it?

TomSweeneyRedHat commented 5 years ago

@jkryl belay that, I just noted the issue is with the WORKDIR directory, a different beast. Let me go play with that.

rhatdan commented 5 years ago

Packages are being built on Fedora now for 1.8.0. I will ask our packagers to begin packaging for Ubuntu, Although I think they follow Master Branch, so their might be a package available for Ubuntu now, with this fix.

TomSweeneyRedHat commented 5 years ago

Need to test, but I suspect #1558 may fix this too. Will try test by Monday morn, if not will tackle this one next.

TomSweeneyRedHat commented 5 years ago

@jkryl Just tested, looks to be fixed with #1558. I love a good BOGO!

`# buildah run tomctr /bin/bash root@8b2775501978:/moac# ls package-lock.json package_tom.json root@8b2775501978:/moac# pwd /moac ``

jkryl commented 5 years ago

Thanks @TomSweeneyRedHat ! I will give it a try when 1.8.1 is out 👍

jkryl commented 5 years ago

Hi @TomSweeneyRedHat, I see that 1.8.1 has been tagged. In case I don't want to build buildah from source (I'm sorry to be lazy), where can I get a buildah binary from? Waiting for new ubuntu package may take too long time. I suppose that first it will appear in fedora buildah package. Correct? Or is there some kind of semi-official container image with latest buildah? thanks

TomSweeneyRedHat commented 5 years ago

Hey @jkryl Actually 1.8.2 has been tagged too. I thought @rhatdan was going to spin up a Fedora variant for that. But I'm thinking he may have got caught up with summit work and hasn't had a change to yet. We skipped 1.8.1 as we followed tagged release with 1.8.2 a day later before we'd a change to build the kit.

If by chance you can play with a container image, you could try podman pull quay.io/buildah/upstream and then run a container from that image. That's 1.9.0-dev, the latest bits in GitHub to date.

rhatdan commented 5 years ago

Fedora 1.8.2 is built and in updates testing.

jkryl commented 5 years ago

I just tested new ubuntu package and I can confirm that the bug was fixed. Thanks!