Adding logic to remove need for makefile with example bash build script
This commit is contained in:
parent
e4922ce92f
commit
9b5b08bb0f
|
|
@ -1,10 +1,10 @@
|
|||
# Built with arch: amd64 flavor: lxde image: ubuntu:20.04
|
||||
# Built with arch: amd64 flavor: lxde image: ${DOCKER_BASE_IMAGE}
|
||||
#
|
||||
################################################################################
|
||||
# base system
|
||||
################################################################################
|
||||
|
||||
FROM ubuntu:20.04 as system
|
||||
ARG DOCKER_BASE_IMAGE
|
||||
FROM ${DOCKER_BASE_IMAGE} as system
|
||||
|
||||
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ RUN apt-get update \
|
|||
################################################################################
|
||||
# builder
|
||||
################################################################################
|
||||
FROM ubuntu:20.04 as builder
|
||||
FROM ${DOCKER_BASE_IMAGE} as builder
|
||||
|
||||
|
||||
RUN sed -i 's#http://archive.ubuntu.com/ubuntu/#mirror://mirrors.ubuntu.com/mirrors.txt#' /etc/apt/sources.list;
|
||||
|
|
|
|||
|
|
@ -5,9 +5,11 @@
|
|||
################################################################################
|
||||
|
||||
# qemu helper for arm build
|
||||
FROM ubuntu:20.04 as amd64
|
||||
ARG DOCKER_BASE_IMAGE
|
||||
|
||||
FROM ${DOCKER_BASE_IMAGE} as amd64
|
||||
RUN apt update && apt install -y qemu-user-static
|
||||
FROM arm64v8/ubuntu:20.04 as system
|
||||
FROM arm64v8/${DOCKER_BASE_IMAGE} as system
|
||||
COPY --from=amd64 /usr/bin/qemu-aarch64-static /usr/bin/
|
||||
|
||||
|
||||
|
|
@ -79,7 +81,7 @@ RUN apt-get update \
|
|||
################################################################################
|
||||
# builder
|
||||
################################################################################
|
||||
FROM ubuntu:20.04 as builder
|
||||
FROM ${DOCKER_BASE_IMAGE} as builder
|
||||
|
||||
|
||||
RUN sed -i 's#http://archive.ubuntu.com/ubuntu/#mirror://mirrors.ubuntu.com/mirrors.txt#' /etc/apt/sources.list;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
# Built with arch: armhf flavor: lxde image: ubuntu:18.04
|
||||
# Built with arch: armhf flavor: lxde image: ${DOCKER_BASE_IMAGE}
|
||||
#
|
||||
################################################################################
|
||||
# base system
|
||||
################################################################################
|
||||
|
||||
ARG DOCKER_BASE_IMAGE
|
||||
|
||||
# qemu helper for arm build
|
||||
FROM ubuntu:18.04 as amd64
|
||||
FROM ${DOCKER_BASE_IMAGE} as amd64
|
||||
RUN apt update && apt install -y qemu-user-static
|
||||
FROM arm32v7/ubuntu:18.04 as system
|
||||
FROM arm32v7/${DOCKER_BASE_IMAGE} as system
|
||||
COPY --from=amd64 /usr/bin/qemu-arm-static /usr/bin/
|
||||
|
||||
|
||||
|
|
@ -75,7 +77,7 @@ RUN apt-get update \
|
|||
################################################################################
|
||||
# builder
|
||||
################################################################################
|
||||
FROM ubuntu:18.04 as builder
|
||||
FROM ${DOCKER_BASE_IMAGE} as builder
|
||||
|
||||
|
||||
RUN sed -i 's#http://archive.ubuntu.com/ubuntu/#mirror://mirrors.ubuntu.com/mirrors.txt#' /etc/apt/sources.list;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
|
||||
#Ensure nothing happens outside the directory this script is ran from
|
||||
cd "$(dirname "$0")"
|
||||
SCRIPT_DIRECTORY=$(pwd)
|
||||
|
||||
ARCHITECTURE=""
|
||||
case $(uname -m) in
|
||||
i386) ARCHITECTURE="386" ;;
|
||||
i686) ARCHITECTURE="386" ;;
|
||||
x86_64) ARCHITECTURE="amd64" ;;
|
||||
arm) dpkg --print-ARCHITECTURE | grep -q "arm64" && ARCHITECTURE="arm64" || ARCHITECTURE="arm" ;;
|
||||
esac
|
||||
|
||||
echo "[INFO] Processor Architecture Detected as $ARCHITECTURE"
|
||||
|
||||
DOCKER_BASE_IMAGE="ubuntu:18.04"
|
||||
DOCKER_FINAL_IMAGE_TAG="dorowu/ubuntu-desktop-lxde-vnc:bionic"
|
||||
|
||||
# Comment or Uncomment as needed to build the appropriate final image
|
||||
# DOCKER_BASE_IMAGE="ubuntu:20.04"
|
||||
# DOCKER_FINAL_IMAGE_TAG="dorowu/ubuntu-desktop-lxde-vnc:latest"
|
||||
|
||||
docker build -t "$DOCKER_FINAL_IMAGE_TAG" -f "Dockerfile.$ARCHITECTURE" \
|
||||
--build-arg DOCKER_BASE_IMAGE="$DOCKER_BASE_IMAGE" \
|
||||
$SCRIPT_DIRECTORY
|
||||
Loading…
Reference in New Issue