From 71861b6ea54738950ac5c8e83e78bbd1215a11ed Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 10 Feb 2019 23:58:32 +0000 Subject: Separate into multiple stages, at least during development. Docker is pretty clever about not rebuilding stuff, but simply having the 6GB XiLinx tarball in the build context is painful, so let's avoid that as much as we can. --- .dockerignore | 3 --- Dockerfile | 11 ----------- Dockerfile.later | 25 ------------------------- Makefile | 4 +++- stage1/Dockerfile | 17 +++++++++++++++++ stage2/Dockerfile | 18 ++++++++++++++++++ stage3/Dockerfile.later | 25 +++++++++++++++++++++++++ 7 files changed, 63 insertions(+), 40 deletions(-) delete mode 100644 .dockerignore delete mode 100644 Dockerfile delete mode 100644 Dockerfile.later create mode 100644 stage1/Dockerfile create mode 100644 stage2/Dockerfile create mode 100644 stage3/Dockerfile.later diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 1c5d569..0000000 --- a/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -Dockerfile.later -Makefile -README.md diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 169fb28..0000000 --- a/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM debian:jessie - -# OK, let's start with the horrible XiLinx stuff because that's least -# likely to change except when we're updating the base Docker image. - -# In theory, using ADD in this form will cause docker to unpack the -# tarball directly into the filesystem, thus saving us an otherwise -# useless 6GB copy operation, which seems worthwhile. - -RUN mkdir /xilinx-unpack -ADD Xilinx_ISE_DS_Lin_14.7_1015_1.tar /xilinx-unpack/ diff --git a/Dockerfile.later b/Dockerfile.later deleted file mode 100644 index 7f9b257..0000000 --- a/Dockerfile.later +++ /dev/null @@ -1,25 +0,0 @@ -FROM debian:jessie - -RUN echo 'deb http://deb.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/backports.list - -# An assortment of normal Debian packages. Might want to move this to -# after the horrible XiLinx stuff so we don't have to redo that very often. - -RUN apt-get update \ - && \ - apt-get install -y \ - avr-libc \ - binutils-avr \ - gcc-arm-none-eabi \ - gcc-avr \ - git \ - python-crypto \ - python-serial \ - python-yaml \ - reprepro \ - ubuntu-archive-keyring \ - ubuntu-dev-tools \ - pbuilder \ - && \ - apt-get -t jessie-backports install -y \ - debootstrap distro-info-data diff --git a/Makefile b/Makefile index 47f508b..69fcb57 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,4 @@ all: - docker build -t alpha-releng . + cd stage1; docker build -t xilinx:loadonly . + cd stage2; docker build -t xilinx:intalled . + cd stage3; docker build -t cryptech-alpha . diff --git a/stage1/Dockerfile b/stage1/Dockerfile new file mode 100644 index 0000000..2881772 --- /dev/null +++ b/stage1/Dockerfile @@ -0,0 +1,17 @@ +FROM debian:jessie + +# Our goal here is just to load the XiLinx tarball into a Debian Jessie image. +# Overriding reason for making this a separate image: we don't want to have +# to send 6GB of build context every time we touch a later stage. + +ADD Xilinx_ISE_DS_Lin_14.7_1015_1.tar /xilinx-unpack/ + +# Given our general paranoia level we probably should be building our +# own debian:jessie image from debootstrap, but leave that for another +# day. Process is reasonably well documented: instead of starting +# from a base image, start by running debootstrap in --foreign mode, +# import that into an initial Docker image, then run `debootstrap +# --second-stage` in the next Dockerfile. Something like: +# +# sudo debootstrap --foreign jessie jessie_chroot +# sudo tar -C jessie_chroot -c . | docker import - my-debian:jessie diff --git a/stage2/Dockerfile b/stage2/Dockerfile new file mode 100644 index 0000000..da030c8 --- /dev/null +++ b/stage2/Dockerfile @@ -0,0 +1,18 @@ +FROM xilinx:loadonly + +# Whack /bin/sh (known issue with XiLinx tools not working with /bin/dash) + +RUN ln -sf /bin/bash /bin/sh + +# Here's where it gets really fun: let's see if we can drive the +# frelling XiLinx installation under Xvfb. Need some tools first, +# then some manual debugging to get the details right. Don't expect +# to need all of the following once we've debugged this. + +RUN apt-get update && apt-get install -y \ + python-xvfbwrapper \ + ratpoison \ + x11-apps \ + x11-utils \ + x11-xserver-utils \ + xautomation diff --git a/stage3/Dockerfile.later b/stage3/Dockerfile.later new file mode 100644 index 0000000..7f9b257 --- /dev/null +++ b/stage3/Dockerfile.later @@ -0,0 +1,25 @@ +FROM debian:jessie + +RUN echo 'deb http://deb.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/backports.list + +# An assortment of normal Debian packages. Might want to move this to +# after the horrible XiLinx stuff so we don't have to redo that very often. + +RUN apt-get update \ + && \ + apt-get install -y \ + avr-libc \ + binutils-avr \ + gcc-arm-none-eabi \ + gcc-avr \ + git \ + python-crypto \ + python-serial \ + python-yaml \ + reprepro \ + ubuntu-archive-keyring \ + ubuntu-dev-tools \ + pbuilder \ + && \ + apt-get -t jessie-backports install -y \ + debootstrap distro-info-data -- cgit v1.2.3