Home > Back-end >  dockerfile COPY does not copy all the files
dockerfile COPY does not copy all the files

Time:06-08

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"]

CodePudding user response:

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.

  • Related