Skip to content

Commit eee1efc

Browse files
committed
Add "builder-deb" base images for building ".deb" packages properly
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
1 parent b2fbd9e commit eee1efc

File tree

21 files changed

+338
-0
lines changed

21 files changed

+338
-0
lines changed

contrib/builder/deb/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# `dockercore/builder-deb`
2+
3+
This image's tags contain the dependencies for building Docker `.deb`s for each of the Debian-based platforms Docker targets.
4+
5+
To add new tags, see [`contrib/builder/deb` in https://github.com/docker/docker](https://github.com/docker/docker/tree/master/contrib/builder/deb), specifically the `generate.sh` script, whose usage is described in a comment at the top of the file.

contrib/builder/deb/build.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
set -e
3+
4+
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
5+
6+
set -x
7+
./generate.sh
8+
for d in */; do
9+
docker build -t "dockercore/builder-deb:$(basename "$d")" "$d"
10+
done
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"!
3+
#
4+
5+
FROM debian:jessie
6+
7+
RUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
8+
9+
ENV GO_VERSION 1.4.2
10+
RUN curl -fsSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xvzC /usr/local
11+
ENV PATH $PATH:/usr/local/go/bin
12+
13+
ENV AUTO_GOPATH 1
14+
ENV DOCKER_BUILDTAGS apparmor selinux
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#
2+
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"!
3+
#
4+
5+
FROM debian:wheezy
6+
RUN echo deb http://http.debian.net/debian wheezy-backports main > /etc/apt/sources.list.d/wheezy-backports.list
7+
8+
RUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
9+
10+
ENV GO_VERSION 1.4.2
11+
RUN curl -fsSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xvzC /usr/local
12+
ENV PATH $PATH:/usr/local/go/bin
13+
14+
ENV AUTO_GOPATH 1
15+
ENV DOCKER_BUILDTAGS apparmor selinux

contrib/builder/deb/generate.sh

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# usage: ./generate.sh [versions]
5+
# ie: ./generate.sh
6+
# to update all Dockerfiles in this directory
7+
# or: ./generate.sh debian-jessie
8+
# to only update debian-jessie/Dockerfile
9+
# or: ./generate.sh debian-newversion
10+
# to create a new folder and a Dockerfile within it
11+
12+
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
13+
14+
versions=( "$@" )
15+
if [ ${#versions[@]} -eq 0 ]; then
16+
versions=( */ )
17+
fi
18+
versions=( "${versions[@]%/}" )
19+
20+
for version in "${versions[@]}"; do
21+
distro="${version%-*}"
22+
suite="${version##*-}"
23+
from="${distro}:${suite}"
24+
25+
mkdir -p "$version"
26+
echo "$version -> FROM $from"
27+
cat > "$version/Dockerfile" <<-EOF
28+
#
29+
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"!
30+
#
31+
32+
FROM $from
33+
EOF
34+
35+
case "$from" in
36+
debian:wheezy)
37+
# add -backports, like our users have to
38+
echo "RUN echo deb http://http.debian.net/debian $suite-backports main > /etc/apt/sources.list.d/$suite-backports.list" >> "$version/Dockerfile"
39+
;;
40+
esac
41+
42+
echo >> "$version/Dockerfile"
43+
44+
# this list is sorted alphabetically; please keep it that way
45+
packages=(
46+
bash-completion # for bash-completion debhelper integration
47+
btrfs-tools # for "btrfs/ioctl.h" (and "version.h" if possible)
48+
build-essential # "essential for building Debian packages"
49+
curl ca-certificates # for downloading Go
50+
debhelper # for easy ".deb" building
51+
dh-systemd # for systemd debhelper integration
52+
git # for "git commit" info in "docker -v"
53+
libapparmor-dev # for "sys/apparmor.h"
54+
libdevmapper-dev # for "libdevmapper.h"
55+
libsqlite3-dev # for "sqlite3.h"
56+
)
57+
echo "RUN apt-get update && apt-get install -y ${packages[*]} --no-install-recommends && rm -rf /var/lib/apt/lists/*" >> "$version/Dockerfile"
58+
59+
echo >> "$version/Dockerfile"
60+
61+
awk '$1 == "ENV" && $2 == "GO_VERSION" { print; exit }' ../../../Dockerfile >> "$version/Dockerfile"
62+
echo 'RUN curl -fsSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xvzC /usr/local' >> "$version/Dockerfile"
63+
echo 'ENV PATH $PATH:/usr/local/go/bin' >> "$version/Dockerfile"
64+
65+
echo >> "$version/Dockerfile"
66+
67+
echo 'ENV AUTO_GOPATH 1' >> "$version/Dockerfile"
68+
awk '$1 == "ENV" && $2 == "DOCKER_BUILDTAGS" { print; exit }' ../../../Dockerfile >> "$version/Dockerfile"
69+
done
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"!
3+
#
4+
5+
FROM ubuntu-debootstrap:trusty
6+
7+
RUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
8+
9+
ENV GO_VERSION 1.4.2
10+
RUN curl -fsSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xvzC /usr/local
11+
ENV PATH $PATH:/usr/local/go/bin
12+
13+
ENV AUTO_GOPATH 1
14+
ENV DOCKER_BUILDTAGS apparmor selinux
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"!
3+
#
4+
5+
FROM ubuntu-debootstrap:utopic
6+
7+
RUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
8+
9+
ENV GO_VERSION 1.4.2
10+
RUN curl -fsSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xvzC /usr/local
11+
ENV PATH $PATH:/usr/local/go/bin
12+
13+
ENV AUTO_GOPATH 1
14+
ENV DOCKER_BUILDTAGS apparmor selinux
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"!
3+
#
4+
5+
FROM ubuntu-debootstrap:vivid
6+
7+
RUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
8+
9+
ENV GO_VERSION 1.4.2
10+
RUN curl -fsSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xvzC /usr/local
11+
ENV PATH $PATH:/usr/local/go/bin
12+
13+
ENV AUTO_GOPATH 1
14+
ENV DOCKER_BUILDTAGS apparmor selinux

hack/make/.build-deb/compat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9

hack/make/.build-deb/control

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Source: docker-core
2+
Maintainer: Docker <support@docker.com>
3+
Homepage: https://dockerproject.com
4+
Vcs-Browser: https://github.com/docker/docker
5+
Vcs-Git: git://github.com/docker/docker.git
6+
7+
Package: docker-core
8+
Architecture: linux-any
9+
Depends: iptables, ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends}
10+
Recommends: aufs-tools,
11+
ca-certificates,
12+
cgroupfs-mount | cgroup-lite,
13+
git,
14+
xz-utils,
15+
${apparmor:Recommends}
16+
Conflicts: docker (<< 1.5~), docker.io, lxc-docker, lxc-docker-virtual-package
17+
Description: Docker: the open-source application container engine
18+
Docker is an open source project to pack, ship and run any application as a
19+
lightweight container
20+
.
21+
Docker containers are both hardware-agnostic and platform-agnostic. This means
22+
they can run anywhere, from your laptop to the largest EC2 compute instance and
23+
they can run anywhere, from your laptop to the largest EC2 compute instance and
24+
everything in between - and they don't require you to use a particular
25+
language, framework or packaging system. That makes them great building blocks
26+
for deploying and scaling web apps, databases, and backend services without
27+
depending on a particular stack or provider.

0 commit comments

Comments
 (0)