Docker image discards files, Sonatype Nexus involved

  docker, dockerfile, git, jenkins, nexus

Sorry if the title is a little vague but I need to find the real culprit.

I have this setup:

-a git repository called MyRepo.

-a Jenkins instance that auto-builds MyRepo. On post-build steps there’s a simple script that executes:

docker build -t$branch .
docker push$branch

-The is the Nexus instance. Here all docker images are saved and can be pulled by docker-compose installations.

-The Dockerfile:

FROM node:8-slim
WORKDIR /usr/src/webapp
COPY package.json ./
COPY site ./site
COPY resources ./resources
COPY node_modules ./node_modules

CMD ["./"]

What I’m seeing is that the final docker image I pull from Nexus doesn’t have some files, eg. this is the original structure of resources folder:


and the docker image is totally missing the js folder.

So, to debug I added in Dockerfile "RUN ls -la resources/awesome/" before and after the "CMD ["./"]" line.
I then watch Jenkins build logs and the output of the command is correct, all folders are there.

So is the issue Nexus side? Is there any cache or something similiar that Nexus uses and avoids updating contents?

Source: Docker Questions