Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Docker images to Alpine Linux #843

Closed
virtualtam opened this issue Apr 2, 2017 · 2 comments
Closed

Migrate Docker images to Alpine Linux #843

virtualtam opened this issue Apr 2, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@virtualtam
Copy link
Member

virtualtam commented Apr 2, 2017

Motivations

Our Docker images are currently based on the debian:jessie base image, and weight around 300 MiB.

This is due to several reasons:

  • the base Debian image weights around 120 MiB
  • it provides APT package management
  • it comes with plenty of system dependencies that might not be relevant in a Docker context

Alpine Linux is a lightweight and minimalist distribution tat revolves around:

  • musl-libc to provide a C/POSIX environment
  • BusyBox to provide a reduced set of system utilities
  • apk for package management (Note: it's totally unrelated to Android's apk tool)

The base image weights 4 MiB and comes with usage documentation to create lightweight service images.

Related articles/posts:

Proposed setup for Shaarli images

  • Alpine Linux 3.6
  • PHP 7.1
  • PHP-FPM 7.1
  • Nginx
  • s6

Note: Supervisor comes with a lot of Python dependencies (with respect to the expected image size) and might be replaced with runit to spare a few MiBs :)

Early results

I've started to fiddle with a new image, here are the early results (before attempting Dockerfile voodoo):

$ docker images

REPOSITORY          TAG             IMAGE ID            CREATED             SIZE
vt-shaarli          latest          b2268683c850        16 minutes ago      116 MB
shaarli/shaarli     latest          c13a3fa1ba4d        35 hours ago        289 MB
debian              jessie          8cedef9d7368        12 days ago         123 MB
alpine              3.5             4a415e366388        4 weeks ago         3.99 MB
@virtualtam virtualtam added this to the 0.9.1 milestone Apr 2, 2017
@virtualtam virtualtam self-assigned this Apr 2, 2017
@ArthurHoaro
Copy link
Member

If apk provides all necessary packages, that's fine with me.
We're talking about disk usage here, not RAM, right?

@virtualtam
Copy link
Member Author

Alpine indeed provides system and PHP packages with good granularity (1 extension => 1 package)

The generated images are more lightweight (I've managed to go down to 75 MiB by replacing supervisor with S6), which means they take less storage space, and by extension use less RAM when running Docker appliances :)

virtualtam added a commit to virtualtam/Shaarli that referenced this issue Apr 9, 2017
Closes shaarli#843

Changed:
- switch base image from Debian:Jessie to Alpine:3.5
- switch to PHP 7.0
- switch from supervisord to s6 to manage services

WIP:
- production/master image

TODO:
- thorough testing of Shaarli pages and features
- production/stable image
- development image

FIXME:
- file uploads (PHP+nginx config)
- theme selection (invalid paths detected)

See:
- https://alpinelinux.org/
- https://wiki.alpinelinux.org/wiki/Nginx_with_PHP
- http://www.skarnet.org/software/s6/
  - http://www.skarnet.org/software/s6/s6-svscan.html
  - http://www.skarnet.org/software/s6/s6-svc.html
  - http://www.skarnet.org/software/s6/s6-svstat.html

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
virtualtam added a commit to virtualtam/Shaarli that referenced this issue May 10, 2017
Closes shaarli#843

Changed:
- switch base image from Debian:Jessie to Alpine:3.5
- switch to PHP 7.0
- switch from supervisord to s6 to manage services

WIP:
- production/master image

TODO:
- thorough testing of Shaarli pages and features
- production/stable image
- development image

FIXME:
- theme selection (invalid paths detected)

See:
- https://alpinelinux.org/
- https://wiki.alpinelinux.org/wiki/Nginx_with_PHP
- http://www.skarnet.org/software/s6/
  - http://www.skarnet.org/software/s6/s6-svscan.html
  - http://www.skarnet.org/software/s6/s6-svc.html
  - http://www.skarnet.org/software/s6/s6-svstat.html

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
virtualtam added a commit to virtualtam/Shaarli that referenced this issue May 30, 2017
Closes shaarli#843

Changed:
- switch base image from Debian:Jessie to Alpine:3.5
- switch to PHP 7.0
- switch from supervisord to s6 to manage services

WIP:
- production/master image

TODO:
- thorough testing of Shaarli pages and features
- production/stable image
- development image

FIXME:
- theme selection (invalid paths detected)

See:
- https://alpinelinux.org/
- https://wiki.alpinelinux.org/wiki/Nginx_with_PHP
- http://www.skarnet.org/software/s6/
  - http://www.skarnet.org/software/s6/s6-svscan.html
  - http://www.skarnet.org/software/s6/s6-svc.html
  - http://www.skarnet.org/software/s6/s6-svstat.html

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
virtualtam added a commit to virtualtam/Shaarli that referenced this issue Jul 29, 2017
Relates to shaarli#843

Changed:
- Update Docker image list
- Update Docker documentation structure

Removed:
- Delete Dockerfile and resources for the `dev` image
- Cleanup `doc/` resources

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
virtualtam added a commit to virtualtam/Shaarli that referenced this issue Jul 29, 2017
Closes shaarli#843

Changed:
- switch base image from Debian:Jessie to Alpine:3.5
- switch to PHP 7.1
- switch from supervisord to s6 to manage services

WIP:
- production/master image

TODO:
- thorough testing of Shaarli pages and features
- production/stable image
- development image

FIXME:
- theme selection (invalid paths detected)

See:
- https://alpinelinux.org/
- https://wiki.alpinelinux.org/wiki/Nginx_with_PHP
- http://www.skarnet.org/software/s6/
  - http://www.skarnet.org/software/s6/s6-svscan.html
  - http://www.skarnet.org/software/s6/s6-svc.html
  - http://www.skarnet.org/software/s6/s6-svstat.html

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
virtualtam added a commit to virtualtam/Shaarli that referenced this issue Jul 29, 2017
Closes shaarli#843

Changed:
- switch base image from Debian:Jessie to Alpine:3.6
- switch to PHP 7.1
- switch from supervisord to s6 to manage services

WIP:
- `master` image

TODO:
- thorough testing of Shaarli pages and features
- `stable` image

FIXME:
- theme selection (invalid paths detected)

See:
- https://alpinelinux.org/
- https://wiki.alpinelinux.org/wiki/Nginx_with_PHP
- http://www.skarnet.org/software/s6/
  - http://www.skarnet.org/software/s6/s6-svscan.html
  - http://www.skarnet.org/software/s6/s6-svc.html
  - http://www.skarnet.org/software/s6/s6-svstat.html

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
virtualtam added a commit to virtualtam/Shaarli that referenced this issue Jul 29, 2017
Relates to shaarli#843

Added:
- Makefile target to run commands in a Docker test context
- Docker images to run Shaarli test suites:
  - Alpine 3.6
  - Debian 8 & 9
  - Ubuntu 16.04

TODO:
- Add/update usage documentation

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
virtualtam added a commit to virtualtam/Shaarli that referenced this issue Aug 1, 2017
Relates to shaarli#843

Added:
- Makefile target to run commands in a Docker test context
- Docker images to run Shaarli test suites:
  - Alpine 3.6
  - Debian 8 & 9
  - Ubuntu 16.04

TODO:
- Add/update usage documentation

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
virtualtam added a commit to virtualtam/Shaarli that referenced this issue Aug 1, 2017
Relates to shaarli#843

Added:
- Makefile target to run commands in a Docker test context
- Docker images to run Shaarli test suites:
  - Alpine 3.6
  - Debian 8 & 9
  - Ubuntu 16.04

TODO:
- Add/update usage documentation

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
@virtualtam virtualtam modified the milestones: 0.9.1, 0.9.2 Aug 3, 2017
virtualtam added a commit to virtualtam/Shaarli that referenced this issue Aug 8, 2017
Relates to shaarli#843

Added:
- Makefile target to run commands in a Docker test context
- Docker images to run Shaarli test suites:
  - Alpine 3.6
  - Debian 8 & 9
  - Ubuntu 16.04

TODO:
- Add/update usage documentation

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
virtualtam added a commit to virtualtam/Shaarli that referenced this issue Aug 27, 2017
Relates to shaarli#843

Added:
- Makefile target to run commands in a Docker test context
- Docker images to run Shaarli test suites:
  - Alpine 3.6
  - Debian 8 & 9
  - Ubuntu 16.04

TODO:
- Add/update usage documentation

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
virtualtam added a commit to virtualtam/Shaarli that referenced this issue Aug 27, 2017
Relates to shaarli#843

Added:
- Makefile target to run commands in a Docker test context
- Docker images to run Shaarli test suites:
  - Alpine 3.6
  - Debian 8
  - Debian 9
  - Ubuntu 16.04
- Documentation

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
virtualtam added a commit to virtualtam/Shaarli that referenced this issue Sep 18, 2017
Relates to shaarli#843

Added:
- Makefile target to run commands in a Docker test context
- Docker images to run Shaarli test suites:
  - Alpine 3.6
  - Debian 8
  - Debian 9
  - Ubuntu 16.04
- Documentation

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
virtualtam added a commit to virtualtam/Shaarli that referenced this issue Sep 19, 2017
Closes shaarli#843

Changed:
- switch base image from Debian:Jessie to Alpine:3.6
- switch to PHP 7.1
- switch from supervisord to s6 to manage services

WIP:
- `master` image

TODO:
- thorough testing of Shaarli pages and features
- `stable` image

FIXME:
- theme selection (invalid paths detected)

See:
- https://alpinelinux.org/
- https://wiki.alpinelinux.org/wiki/Nginx_with_PHP
- http://www.skarnet.org/software/s6/
  - http://www.skarnet.org/software/s6/s6-svscan.html
  - http://www.skarnet.org/software/s6/s6-svc.html
  - http://www.skarnet.org/software/s6/s6-svstat.html

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
virtualtam added a commit to virtualtam/Shaarli that referenced this issue Sep 30, 2017
Closes shaarli#843

Changed:
- switch base image from Debian:Jessie to Alpine:3.6
- switch to PHP 7.1
- switch from supervisord to s6 to manage services

WIP:
- `master` image

TODO:
- thorough testing of Shaarli pages and features
- `stable` image

FIXME:
- theme selection (invalid paths detected)

See:
- https://alpinelinux.org/
- https://wiki.alpinelinux.org/wiki/Nginx_with_PHP
- http://www.skarnet.org/software/s6/
  - http://www.skarnet.org/software/s6/s6-svscan.html
  - http://www.skarnet.org/software/s6/s6-svc.html
  - http://www.skarnet.org/software/s6/s6-svstat.html

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
virtualtam added a commit to virtualtam/Shaarli that referenced this issue Oct 3, 2017
Relates to shaarli#843

Changed:
- switch base image from Debian:Jessie to Alpine:3.6
- switch to PHP 7.1
- switch from supervisord to s6 to manage services

See:
- https://alpinelinux.org/
- https://wiki.alpinelinux.org/wiki/Nginx_with_PHP
- http://www.skarnet.org/software/s6/
  - http://www.skarnet.org/software/s6/s6-svscan.html
  - http://www.skarnet.org/software/s6/s6-svc.html
  - http://www.skarnet.org/software/s6/s6-svstat.html

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
@ArthurHoaro ArthurHoaro modified the milestones: 0.9.2, 0.9.3 Oct 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants