Git Product home page Git Product logo

docker-log's Introduction

One of my projects uses Playwright, and that involves a pretty big image. When you run the Playwright install, even if you only include one of the browsers, the size of that layer is about 800MB.

This was a quick investigation to see how I could control rebuilding image layers. Remember of course that once one layer needs to be rebuild, all the layers below that layer will also need rebuilding.

In this example I wanted to rebuild the RUN git clone... and below if I had changed the repo. To achieve that, I added the ARG CACHEBUST line above the RUN git clone.... The value of CACHEBUST is defined in the docker-compose.yml file and to force a rebuild, the value needs to be changed. This will cause that layer and all subsequent layers to be rebuilt.

The actual value for that ARG is stored as part of the Image and so if you haven't cleaned up your images and you set it to a value that you have used before, you might find you use an old cached version instead of building a new image.

Note that in order for this to work, you must include the --build option when running your docker-compose cmd e.g.:

docker-compose up --build -d

I also decided to get rid of the startup.sh file and call my real CMD directly in the Dockerfile as I was having issues with permissions and line endings.

docker-log's People

Contributors

greywidget avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.