Skip to content

Commit

Permalink
add ubuntu 16.04 support
Browse files Browse the repository at this point in the history
Signed-off-by: Adphi <[email protected]>
  • Loading branch information
Adphi committed Aug 23, 2024
1 parent e31bc93 commit d8ee378
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dockerfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ func NewDockerfile(release OSRelease, img, password string, networkManager Netwo
net = NetworkManagerIfupdown2
case ReleaseUbuntu:
d.tmpl = ubuntuDockerfileTemplate
net = NetworkManagerNetplan
if release.VersionID < "18.04" {
net = NetworkManagerIfupdown2
} else {
net = NetworkManagerNetplan
}
case ReleaseAlpine:
d.tmpl = alpineDockerfileTemplate
net = NetworkManagerIfupdown2
Expand Down
2 changes: 2 additions & 0 deletions templates/ubuntu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ RUN ARCH="$([ "$(uname -m)" = "x86_64" ] && echo amd64 || echo arm64)"; \
iputils-ping && \
find /boot -type l -exec rm {} \;

{{ if gt .Release.VersionID "16.04" }}
RUN systemctl preset-all
{{ end }}

{{ if .Password }}RUN echo "root:{{ .Password }}" | chpasswd {{ end }}

Expand Down

0 comments on commit d8ee378

Please sign in to comment.