DiUS / pact_broker-docker

'Dockerised' pact broker
http://pact.io
MIT License
76 stars 102 forks source link

Check if we need to upgrade the OS inside the container #34

Closed bethesque closed 5 years ago

bethesque commented 7 years ago

From https://github.com/phusion/passenger-docker#upgrading-the-operating-system-inside-the-container

Upgrading the operating system inside the container

passenger-docker images contain an Ubuntu 16.04 operating system. You may want to update this OS from time to time, for example to pull in the latest security updates. OpenSSL is a notorious example. Vulnerabilities are discovered in OpenSSL on a regular basis, so you should keep OpenSSL up-to-date as much as you can.

While we release passenger-docker images with the latest OS updates from time to time, you do not have to rely on us. You can update the OS inside passenger-docker images yourself, and it is recommend that you do this instead of waiting for us.

To upgrade the OS in the image, run this in your Dockerfile:

RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold"

k-ong commented 6 years ago

Looking into this as part of https://github.com/DiUS/pact_broker-docker/issues/52. Upgrading the OS packages especially security updates would be advisable but uncompressed image sizes tend to hit 1.0Gb to 1.1Gb for ubuntu systems.

YOU54F commented 5 years ago

The OS update is already happening in the docker file.

RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold"

https://github.com/DiUS/pact_broker-docker/blob/80dae57291b82509ca5a4dd99e15839dfc5c1e90/Dockerfile#L8

The base image currently is at 18.04.01

https://github.com/phusion/baseimage-docker/pull/488

The following command will upgrade the OS to 18.04.02 but leaves the image at over 1gb.

apt-get upgrade -y -o Dpkg::Options::="--force-confold

Without the forced upgrade, the image is not much bigger, uncompressed that the base image it is built upon.

We can look to clean up after the upgrade, which should bring the size down. 👍

bethesque commented 5 years ago

@YOU54F I got that update line from the passenger docker docs. Perhaps you could suggest your improved line so that other people don't have the same problem? A PR for this section would be handy: https://github.com/phusion/passenger-docker#upgrading-the-operating-system-inside-the-container

YOU54F commented 5 years ago

Have done mate, nice one 👌