docker/tools: build script and Dockerfile work now

This commit is contained in:
Kyle Isom 2023-04-10 05:03:23 +00:00
parent 53f337c255
commit 9f492fb42b
2 changed files with 17 additions and 1 deletions

10
tools/Dockerfile Normal file
View File

@ -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"]

View File

@ -17,6 +17,8 @@ preflight () {
case "$(uname -m)" in case "$(uname -m)" in
amd64) ARCH="amd64" ;; amd64) ARCH="amd64" ;;
arm64) ARCH="arm64" ;; arm64) ARCH="arm64" ;;
x86_64) ARCH="amd64" ;;
*) *)
echo "[!] $(uname -m) is an unsupported architecture." > /dev/stderr echo "[!] $(uname -m) is an unsupported architecture." > /dev/stderr
echo '[!] supported architectures: amd64, arm64' > /dev/stderr echo '[!] supported architectures: amd64, arm64' > /dev/stderr
@ -42,7 +44,7 @@ install_godeb () {
popd popd
} }
install_go { install_go () {
pushd /tmp pushd /tmp
echo '[*] installing go - this will request sudo' echo '[*] installing go - this will request sudo'
godeb install "${GOVERSION}" godeb install "${GOVERSION}"
@ -50,3 +52,7 @@ install_go {
# if needed. # if needed.
popd popd
} }
preflight
install_godeb
install_go