threefoldtech / tf-images

Apache License 2.0
1 stars 3 forks source link

Use base images #178

Open scottyeager opened 1 year ago

scottyeager commented 1 year ago

Currently most or all of the images include sshd along with an init script to set the authorized key and a zinit unit file to run both the script and daemon. This means that the implementations can diverge, and even in the best case that they are consistent, its difficult to maintain and implement a change across all images such as for #165.

Edit: removed original plan in favor of proposal outlined below.

scottyeager commented 1 year ago

Depending on the route we take for host keys, shared files among images could be reduced to just the unit file that launches sshd, thus making this issue less relevant.

Edit: while host key handling will be done by Zos/cloud-container, using base images to factor out common code and get it right once is still worthwhile.

scottyeager commented 11 months ago

After working a bit on updating all images to mitigate the host keys issue, I've generated some additional insights:

So my updated proposal is as follows:

  1. Merge base Ubuntu images (and Debian?) into a single folder and Dockerfile which is used to generate all of the different tags we supply as official images
  2. Make all ubuntu:* based solutions derive from our base Ubuntu images, and remove boilerplate which has become duplicated
  3. For remaining images which still Ubuntu/Debian based but don't derive from ubuntu:* (just debian and wordpress?), link in the boilerplate files as originally suggested
  4. Evaluate if any other images need the same treatment (CentOS)
scottyeager commented 11 months ago

I've implemented the ideas from my last comment in this repo (keeping it separate to avoid package clutter).

A couple more insights from this work: