Skip to content

Base image on Alpine to optimize image size - #21

Open
elias5000 wants to merge 1 commit into
OliverF:masterfrom
elias5000:small-image
Open

Base image on Alpine to optimize image size#21
elias5000 wants to merge 1 commit into
OliverF:masterfrom
elias5000:small-image

Conversation

@elias5000

Copy link
Copy Markdown
  • Size is reduced to ~55MiB from ~680MiB before by using plain Alpine as base

Size is reduced to ~55MiB from ~680MiB before
@Silex

Silex commented Jan 19, 2018

Copy link
Copy Markdown
Contributor

Hum I think what you said in #20 is innacurate:

python               2.7-alpine          0781c116c406        9 days ago          72.4MB
python               2.7-alpine3.7       8a6404845d59        9 days ago          68.1MB

I think your idea to use alpine as the base is good, but I'm not sure using alpine:3.7 over python:2.7-alpine is the best solution...

Advantages for using python:2.7-alpine as the base image is that you control the version more explicitely. Advantage for using alpine:3.7 is you chop 20 MB more.

mjpeg-relay-alpine           latest      31a034709369        36 seconds ago      55.8MB
mjpeg-relay-python-alpine    latest      65012f5e061e        9 seconds ago       76.1MB

Any other pros/cons you see?

@elias5000

Copy link
Copy Markdown
Author

My goal was to get the image as tiny as possible.
It's a matter of taste whether to take the alpine image from python (which installs python from source) or plain Alpine which installs python from the repository.

For me saving ~25% image size is making the difference.

@Silex

Silex commented Jan 19, 2018

Copy link
Copy Markdown
Contributor

Alright. Let's wait for @OliverF to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants