Rework the Dockerfiles

This commit is contained in:
Johan Gunnarsson 2019-04-03 20:36:34 +02:00
parent 8902128249
commit 7f455fc900
5 changed files with 164 additions and 36 deletions

View File

@ -1,22 +1,34 @@
FROM debian:latest # Native amd64
RUN apt-get update FROM debian:stable-slim
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y install debootstrap \ RUN apt-get update && \
debian-archive-keyring \ apt-get --assume-yes \
git \ --no-install-recommends \
crossbuild-essential-arm64 \ install debootstrap \
crossbuild-essential-armhf \ debian-archive-keyring \
qemu-user-static \ ca-certificates \
device-tree-compiler \ qemu-user-static \
bison \ device-tree-compiler \
flex \ gcc \
python-dev \ make \
swig \ git \
parted \ bc \
e2fsprogs \ bison \
dosfstools \ flex \
mtools \ python-dev \
pwgen swig \
parted \
e2fsprogs \
dosfstools \
mtools \
pwgen && \
([ "$(uname -m)" = "x86_64" ] && \
apt-get --assume-yes \
install gcc-aarch64-linux-gnu \
gcc-arm-linux-gnueabihf) && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -f /var/log/*.log
ENV PATH="/debimg:${PATH}" ENV PATH="/debimg:${PATH}"
COPY . /debimg COPY . /debimg
WORKDIR /debimg WORKDIR /debimg

View File

@ -0,0 +1,29 @@
# Native armhf
FROM arm32v7/debian:stable-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get --assume-yes \
--no-install-recommends \
install debootstrap \
debian-archive-keyring \
ca-certificates \
device-tree-compiler \
gcc \
make \
git \
bc \
bison \
flex \
python-dev \
swig \
parted \
e2fsprogs \
dosfstools \
mtools \
pwgen && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -f /var/log/*.log
ENV PATH="/debimg:${PATH}"
COPY . /debimg
WORKDIR /debimg

View File

@ -0,0 +1,40 @@
# Build host is assumed to have "update-binfmts --enable qemu-arm"
# First get qemu-user-static for host...
FROM debian:stable-slim as host
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get --assume-yes \
install qemu-user-static
# ...then build image for target with help of qemu-user-static
FROM arm32v7/debian:stable-slim
ENV DEBIAN_FRONTEND=noninteractive
COPY --from=host /usr/bin/qemu-arm-static /usr/bin/
RUN apt-get update && \
apt-get --assume-yes \
--no-install-recommends \
install debootstrap \
debian-archive-keyring \
ca-certificates \
device-tree-compiler \
gcc \
make \
git \
bc \
bison \
flex \
python-dev \
swig \
parted \
e2fsprogs \
dosfstools \
mtools \
pwgen && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -f /var/log/*.log
RUN rm /usr/bin/qemu-arm-static
ENV PATH="/debimg:${PATH}"
COPY . /debimg
WORKDIR /debimg

View File

@ -1,22 +1,29 @@
FROM debian:latest # Native arm64
RUN apt-get update FROM arm64v8/debian:stable-slim
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y install debootstrap \ RUN apt-get update && \
debian-archive-keyring \ apt-get --assume-yes \
git \ --no-install-recommends \
build-essential \ install debootstrap \
gcc-arm-linux-gnueabihf \ debian-archive-keyring \
device-tree-compiler \ ca-certificates \
bc \ device-tree-compiler \
bison \ gcc \
flex \ make \
python-dev \ git \
swig \ bc \
parted \ bison \
e2fsprogs \ flex \
dosfstools \ python-dev \
mtools \ swig \
pwgen parted \
e2fsprogs \
dosfstools \
mtools \
pwgen && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -f /var/log/*.log
ENV PATH="/debimg:${PATH}" ENV PATH="/debimg:${PATH}"
COPY . /debimg COPY . /debimg
WORKDIR /debimg WORKDIR /debimg

View File

@ -0,0 +1,40 @@
# Build host is assumed to have "update-binfmts --enable qemu-aarch64"
# First get qemu-user-static for host...
FROM debian:stable-slim as host
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get --assume-yes \
install qemu-user-static
# ...then build image for target with help of qemu-user-static
FROM arm64v8/debian:stable-slim
ENV DEBIAN_FRONTEND=noninteractive
COPY --from=host /usr/bin/qemu-aarch64-static /usr/bin/
RUN apt-get update && \
apt-get --assume-yes \
--no-install-recommends \
install debootstrap \
debian-archive-keyring \
ca-certificates \
device-tree-compiler \
gcc \
make \
git \
bc \
bison \
flex \
python-dev \
swig \
parted \
e2fsprogs \
dosfstools \
mtools \
pwgen && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -f /var/log/*.log
RUN rm /usr/bin/qemu-aarch64-static
ENV PATH="/debimg:${PATH}"
COPY . /debimg
WORKDIR /debimg