envygeeks / jekyll-docker

⛴ Docker images, and CI builders for Jekyll.
ISC License
993 stars 279 forks source link

Some trouble with volatile files #349

Open white-gecko opened 1 year ago

white-gecko commented 1 year ago

I'm unsure if this is the intended behavior but it made it impossible for me ti use this a base image to preinstall my gems.

With this minimal Dockerfile:

FROM jekyll/jekyll

RUN touch bla && ls -la
RUN ls -la

you can see, that the newly created file is gone on the next layer.

docker build -t stuff .
Sending build context to Docker daemon  2.048kB
Step 1/3 : FROM jekyll/jekyll
latest: Pulling from jekyll/jekyll
df9b9388f04a: Pull complete 
837e9cfc7e43: Pull complete 
c7850f1a8c23: Pull complete 
6ca4c39baa3d: Pull complete 
daa3a8cb79d3: Pull complete 
cfa6df285532: Pull complete 
Digest: sha256:749d902cdf4832168939541586c0a264b582a3bd15d7df25e5798e4d4f226e47
Status: Downloaded newer image for jekyll/jekyll:latest
 ---> 88c6062194fe
Step 2/3 : RUN touch bla && ls -la
 ---> Running in 629052ff5afc
total 8
drwxr-xr-x    2 jekyll   jekyll        4096 Nov  9 09:38 .
drwxr-xr-x    1 root     root          4096 Oct  9 23:41 ..
-rw-r--r--    1 root     root             0 Nov  9 09:38 bla
Removing intermediate container 629052ff5afc
 ---> be2d97ab3f93
Step 3/3 : RUN ls -la
 ---> Running in be1c6da33ff0
total 8
drwxr-xr-x    2 jekyll   jekyll        4096 Oct  9 23:41 .
drwxr-xr-x    1 root     root          4096 Oct  9 23:41 ..
Removing intermediate container be1c6da33ff0
 ---> 00b477b0ee3f
Successfully built 00b477b0ee3f
Successfully tagged stuff:latest

MAybe this is also the reason for e.g. #348?