Giter Site home page Giter Site logo

docker-nginx-alpine-amplify's Introduction

Visitors

Hi!

I'm Connor and I'm a Devops engineer specialising in Docker, AWS and Node.JS. I also go by Makeshift, because mashing things together to work in ways they were never intended is my thing.

Feel free to explore the endless list of unfinished projects on my GitHub. You'll find projects to do with work, gaming, stuff for friends, and a bunch of other random one-off things. Some of them might even be useful!


Makeshift's GitHub stats Top Langs

docker-nginx-alpine-amplify's People

Contributors

cdarwin avatar dependabot[bot] avatar gdzien avatar makeshift avatar mikhailov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

docker-nginx-alpine-amplify's Issues

Making the image smaller

This is an issue thread I'd like to maintain for ideas for making the image smaller. It's currently a fairly chunky 134MB, most of which is Python and its Packages.

Ideas I've tried

  • Combining the sites-packages directories - Same size, much higher potential corruption possibilities
  • Using pip's --no-cache-dir option - The cache dir doesn't end up in /opt/venv, so it gets deleted during the multi-stage build process anyway, so it makes no difference

Ideas I haven't tried yet

  • Delete psutil earlier - This would remove the delete layer and psutil's footprint from the final image, saving about 1.5MB
  • Use system packages instead of pip install - They might be smaller and faster to install? Need to check what's available in Alpine's packages
  • Use a small alpine Python container and add Nginx on top of that instead - I don't think this will make much of a difference since python:alpine is already 49MB (the layer adding python+util-linux in the current Dockerfile adds 54MB, so there might be a couple of MB savings), but there might be smaller images that can be used as a base. This makes parity with nginx:alpine and #1 more difficult though.
  • Use scratch instead of Alpine - that would be a fun weekend project. It's slightly out of the realm of this repository but definitely something I want to try.
  • Find a tree-shaking/bundling library - This is probably the most likely candidate, but that's based on my experience of JS, so iuno.

Current Layer Details

As of 12:47 12/09/22, makeshift27015/nginx-alpine-amplify:latest on amd64 looks like this, according to dive:
image

According to Dive, there's 2.6 MB we could potentially recover, but I think in practice that would be difficult. Most of the files that are being replaced between the base nginx:alpine layer and the apk add layer are python dependencies that get updated during install, eg ca-certificates and the Alpine installed db which I doubt I could do anything with. I could stop apk from updating these, but they're kinda nice to have up to date anyway.

The easiest option would be to recover as much of this 2.6 MB as possible would be to create another stage based on alpine:latest and simply copy / from the (current) final stage, but that's dirty as hell for 2.6MB and probably wouldn't recover that much because most of those files will exist in the base alpine image also.

Please reply with more ideas :)

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.