Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dockerfile COPY does not copy all the files

I do

  • git clone https://github.com/openzipkin/zipkin.git
  • cd zipkin

The create a Dockerfile as below

FROM openjdk

RUN mkdir app

WORKDIR /app

COPY ./ .

ENTRYPOINT ["sleep", "1000000"]

then

  • docker build -t abc .
  • docker run abc

I then run docker exec -it CONTAINER_ID bash

pwd returns /app which is expected

but I ls and see that the files are not copied

only the directories and the xml file is copied into the /app directory

enter image description here

What is the reason? how to fix it?

Also I tried

FROM openjdk

RUN mkdir app

WORKDIR /app

COPY . /app

ENTRYPOINT ["sleep", "1000000"]
like image 745
Amin Ba Avatar asked Oct 19 '25 02:10

Amin Ba


1 Answers

That repository contains a .dockerignore file which excludes everything except a set of things it selects.

That repository's docker directory also contains several build scripts for official images and you may find it easier to start your custom image FROM openzipkin/zipkin rather than trying to reinvent it.

like image 124
David Maze Avatar answered Oct 20 '25 16:10

David Maze



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!