So I do some docker things:
$ ls project
README.md src
$ ls project/src
main test
$ cat Dockerfile
# ... other stuff...
WORKDIR /work
COPY /project/* ./
RUN ls
# ... other stuff
$ docker build .
# ...... stuff
Step 5/50 : COPY /project/* ./
---> 212131bcda
Step 6/50 : RUN ls
---> Running in deadbeef
README.md main test
Wat. I expect the contents of /work
to be README.md
and src
. Why has docker
copied README.md
as is, and then sees a directory (src
), descends into it, and
starts copying from there? That makes no sense. No (reasonable?) shell would behave
that way.
The "correct" formulation seems to be COPY /project/. ./
, which, ok, that's valid,
but... sigh.
Yeah docker COPY is bizarre. I dunno what they were thinking. (I googled "docker COPY is weird" looking for some kind of explanation and ended up here)