diff --git a/tools/Dockerfile b/tools/Dockerfile new file mode 100644 index 0000000..040fd0d --- /dev/null +++ b/tools/Dockerfile @@ -0,0 +1,10 @@ +# Set up a packer image in Docker. +FROM ubuntu:22.04 +LABEL org.opencontainers.image.authors=kyle@imap.cc + +RUN apt-get update && apt-get -y install git bash curl sudo + +ADD . tools +RUN tools/install-go.sh + +ENTRYPOINT ["/usr/bin/env", "bash"] diff --git a/tools/install-go.sh b/tools/install-go.sh index 89b6620..f2fff98 100755 --- a/tools/install-go.sh +++ b/tools/install-go.sh @@ -17,6 +17,8 @@ preflight () { case "$(uname -m)" in amd64) ARCH="amd64" ;; arm64) ARCH="arm64" ;; + x86_64) ARCH="amd64" ;; + *) echo "[!] $(uname -m) is an unsupported architecture." > /dev/stderr echo '[!] supported architectures: amd64, arm64' > /dev/stderr @@ -42,7 +44,7 @@ install_godeb () { popd } -install_go { +install_go () { pushd /tmp echo '[*] installing go - this will request sudo' godeb install "${GOVERSION}" @@ -50,3 +52,7 @@ install_go { # if needed. popd } + +preflight +install_godeb +install_go