apt-get errors building Ubuntu based Docker images from old images

Turns out if you have an older base image downloaded locally and you try to rebuild your own image based on it a couple of years later, you could get errors running apt-get in your own Dockerfiles. I just got errors like this rebuilding an image that I first created 2 years ago:

Err http://archive.ubuntu.com/ubuntu/ trusty-updates/main libcurl3 amd64 7.35.0-1ubuntu2.14
404  Not Found [IP: 91.189.88.149 80]
Get:16 http://archive.ubuntu.com/ubuntu/ trusty-updates/main ca-certificates all 20170717~14.04.1 [167 kB]
Err http://archive.ubuntu.com/ubuntu/ trusty-updates/main krb5-locales all 1.12+dfsg-2ubuntu5.3
404  Not Found [IP: 91.189.88.149 80]
Get:17 http://archive.ubuntu.com/ubuntu/ trusty/main libsasl2-modules amd64 2.1.25.dfsg1-17build1 [64.3 kB]
Err http://security.ubuntu.com/ubuntu/ trusty-security/main libcurl3 amd64 7.35.0-1ubuntu2.14
  404  Not Found [IP: 91.189.88.31 80]
Err http://security.ubuntu.com/ubuntu/ trusty-security/main openssl amd64 1.0.1f-1ubuntu2.23
  404  Not Found [IP: 91.189.88.31 80]
Err http://security.ubuntu.com/ubuntu/ trusty-security/main curl amd64 7.35.0-1ubuntu2.14
  404  Not Found [IP: 91.189.88.31 80]
Fetched 1375 kB in 7s (175 kB/s)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/k/krb5/libkrb5support0_1.12+dfsg-2ubuntu5.3_amd64.deb  404  Not Found [IP: 91.189.88.149 80]

If you delete the base ubuntu image you have cached locally, and try again, you’ll pull down a latest image, and now your build should continue as expected.

Docker with remote servers

2025 update: Use docker contexts instead.

Original post:

If you’re running Docker without TLS (hopefully never in production, for dev only), set DOCKER_HOST to host-ip:2375 and should should be good to go:

export DOCKER_HOST=tcp://host-ip:2375

If you’re using TLS certs, point to 2376 on the remote machine and specify a path to the certs:

export DOCKER_HOST=tcp://host-ip:2376
export DOCKER_CERT_PATH=/path/to/certs

Pass the –tlsverify param to ensure certs are passed with command:

docker --tlsverify command

Use docker-compose against a remote machine with TLS certs:

docker-compose -H remote-server-ip:2376 --tlscacert ca.pem --tlscert cert.pem --tlskey key.pem -f docker-compose.yml up

How to setup your Docker server to use TLS certs is here: https://docs.docker.com/engine/security/https/

2 years later: 2 years of running WordPress and MySQL on Docker in a VPS

It’s been 2 years since I migrated this site from a native install on a VPS to another VPS running Docker. I covered my migration in a number of posts, the first of which is here:

The surprising thing (maybe? maybe not?) is that the site has been up and running for the past 2 years with no issues. I think I rebooted the VPS a couple of times for reasons I can’t remember, but other than that the site’s been up reliably for the past 2 years.

It’s also been 2 years since I last renewed my SSL certificate, so time to do a couple of updates. More to come later.

Running Oracle 19c in a Docker container: part 2: server up and running

Following on from my first attempt to get Oracle 19c running in a Docker container and running out of disk space in my VM, I increased the disk space to 40GB and restarted the steps to build the image. It took about 1.5hrs to complete building and doing the install into the image. Although building an image is a one time activity, unless you’re making changes to the image that’s still a long time, and not something you can do on a regular basis or on demand.

Next, starting up an container from the image, using the provided docker command from the docs:

docker run --name <container name> \
-p <host port>:1521 -p <host port>:5500 \
-e ORACLE_SID=<your SID> \
-e ORACLE_PDB=<your PDB name> \
-e ORACLE_PWD=<your database passwords> \
-e ORACLE_CHARACTERSET=<your character set> \
-v [<host mount point>:]/opt/oracle/oradata \
oracle/database:19.3.0-se2

It then takes around 30mins before the server is actually up and running. At least it gives you some percentage status outputs as it’s starting up, but again, not really practical for starting a server up ondemand or on a whim. For reference, this is on my HP DL380 G7 server with dual 2.4GHz Xeons, running in an Ubuntu 18.04 VM with 4 vCpus and 8GB RAM.

Up and running:

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 24-MAY-2019 04:55:03
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Starting /opt/oracle/product/19c/dbhome_1/bin/tnslsnr: please wait…
TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/8363ae964727/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 24-MAY-2019 04:55:04
Uptime 0 days 0 hr. 0 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/8363ae964727/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
The listener supports no services
The command completed successfully

Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
/opt/oracle/cfgtoollogs/dbca/ORADB1.
Database Information:
Global Database Name:ORADB1
System Identifier(SID):ORADB1
Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORADB1/ORADB1.log" for further details.
SQL*Plus: Release 19.0.0.0.0 - Production on Fri May 24 05:17:49 2019
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

Created a connection in SQLDeveloper and can connect!