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
RUN apt-get update
# Native amd64
FROM debian:stable-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y install debootstrap \
debian-archive-keyring \
git \
crossbuild-essential-arm64 \
crossbuild-essential-armhf \
qemu-user-static \
device-tree-compiler \
bison \
flex \
python-dev \
swig \
parted \
e2fsprogs \
dosfstools \
mtools \
pwgen
RUN apt-get update && \
apt-get --assume-yes \
--no-install-recommends \
install debootstrap \
debian-archive-keyring \
ca-certificates \
qemu-user-static \
device-tree-compiler \
gcc \
make \
git \
bc \
bison \
flex \
python-dev \
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}"
COPY . /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
RUN apt-get update
# Native arm64
FROM arm64v8/debian:stable-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y install debootstrap \
debian-archive-keyring \
git \
build-essential \
gcc-arm-linux-gnueabihf \
device-tree-compiler \
bc \
bison \
flex \
python-dev \
swig \
parted \
e2fsprogs \
dosfstools \
mtools \
pwgen
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-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