This historical Ubuntu walkthrough covers Docker package versions and logging drivers. Package versions, repository configuration, and supported drivers depend on the Docker Engine and Ubuntu releases in use.
Downgrade docker
- First stop the docker
- Remove the Docker packages without purging data directories.
- Install the old docker version.
$sudo systemctl stop docker
$sudo apt-get remove -y docker-ce docker-ce-cli
$sudo apt-get update
$sudo apt-get install -y docker-ce=5:18.09.4~3-0~ubuntu-bionic docker-ce-cli=5:18.09.4~3-0~ubuntu-bionic
docker versionUpgrade docker
Here there is no need to remove the package or stop the docker.
$sudo apt-get install -y docker-ce=5:18.09.5~3-0~ubuntu-bionic docker-ce-cli=5:18.09.5~3-0~ubuntu-bionic
$docker versionConfiguring logging drivers - splunk journald, etc
Docker logging drivers route container logs to a selected destination. Driver capabilities and options vary by Docker Engine version.
reference - (https://docs.docker.com/config/containers/logging/configure/)
Check the current default driver, then edit /etc/docker/daemon.json. This example uses
the json-file driver:
$docker info --format ''
$sudo vi /etc/docker/daemon.json
{
"log-driver": "json-file",
"log-opts": {
"max-size": "15m"
}
}Next, restart docker after editing daemon.json
$sudo systemctl restart dockerIf you run a docker container, overwrite the system default logging driver settings for individual container.
$docker run --log-driver json-file --log-opt max-size=50m nginxor syslog
$docker run --log-driver syslog nginxRestarting Docker can affect running containers; plan a maintenance window and consult the documentation for the installed version.