summaryrefslogtreecommitdiffstats
path: root/docker/builder-include
diff options
context:
space:
mode:
authorGeoff Levand <geoff@infradead.org>2018-05-21 19:59:39 +0000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-05-23 11:11:36 +1000
commit1c45cf6e9393e8c27acfa7c86ea305bcc26ff258 (patch)
tree4930300e91bacccd1657de6ab3ca643c32d51c85 /docker/builder-include
parent1214247667d138e2fa1748f4f270e5fc80010377 (diff)
downloadtalos-petitboot-1c45cf6e9393e8c27acfa7c86ea305bcc26ff258.tar.gz
talos-petitboot-1c45cf6e9393e8c27acfa7c86ea305bcc26ff258.zip
docker: Add DOCKER_FROM arg
The dockerfile for each architecture is the same except for the 'FROM' image. Add a new Dockerfile argument DOCKER_FROM that allows for a commom dockerfile. If the docker version is older than 17.05 generate a docker file from the common one. Signed-off-by: Geoff Levand <geoff@infradead.org> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'docker/builder-include')
-rw-r--r--docker/builder-include13
1 files changed, 13 insertions, 0 deletions
diff --git a/docker/builder-include b/docker/builder-include
index 40e0120..87405b8 100644
--- a/docker/builder-include
+++ b/docker/builder-include
@@ -19,6 +19,19 @@ arch_tag() {
esac
}
+docker_from() {
+ local a="$(arch)"
+
+ case "${a}" in
+ amd64) echo "ubuntu:17.10" ;;
+ arm64) echo "arm64v8/ubuntu:17.10" ;;
+ *)
+ echo "${name}: ERROR: Unknown arch ${a}" >&2
+ exit 1
+ ;;
+ esac
+}
+
run_cmd () {
local cmd="${*}"
OpenPOWER on IntegriCloud