├── LICENSE ├── README.md ├── components ├── generate-stackbrew-library.sh ├── jessie └── include ├── latest ├── mirror ├── mkimage.sh ├── oldstable └── include ├── repo ├── sid ├── include └── merged-usr ├── slim-excludes ├── stable └── include ├── stretch ├── include └── merged-usr ├── testing ├── include └── merged-usr ├── unstable ├── include └── merged-usr ├── update.sh └── wheezy └── include /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # **DEPRECATED** 2 | 3 | This repository is now deprecated in favor of https://github.com/debuerreotype/docker-debian-artifacts, which builds reproducible Debian rootfs tarballs using https://github.com/debuerreotype/debuerreotype. 4 | 5 | # About this Repo 6 | 7 | This is the Git repo of the Docker [official image](https://docs.docker.com/docker-hub/official_repos/) for [debian](https://registry.hub.docker.com/_/debian/). See [the Docker Hub page](https://registry.hub.docker.com/_/debian/) for the full readme on how to use this Docker image and for information regarding contributing and issues. 8 | 9 | The full readme is generated over in [docker-library/docs](https://github.com/docker-library/docs), specificially in [docker-library/docs/debian](https://github.com/docker-library/docs/tree/master/debian). 10 | 11 | ## Maintainers 12 | 13 | This image is maintained by [tianon](https://nm.debian.org/public/person/tianon) and [paultag](https://nm.debian.org/public/person/paultag), who are Debian Developers. 14 | 15 | ## Building 16 | 17 | This image is built using [`contrib/mkimage.sh` from `github.com/docker/docker`](https://github.com/docker/docker/blob/master/contrib/mkimage.sh), where the interesting bits live in [`contrib/mkimage/debootstrap`](https://github.com/docker/docker/blob/master/contrib/mkimage/debootstrap). The `mkimage.sh` file here is a symlink to my local copy of that `mkimage.sh` script (which enables it to find the `debootstrap` script it needs). 18 | 19 | The [`master` branch](https://github.com/tianon/docker-brew-debian) contains the scripts and is where any "development" happens, and the [`dist` branch](https://github.com/tianon/docker-brew-debian/tree/dist) contains the built tarballs and the build logs. 20 | -------------------------------------------------------------------------------- /components: -------------------------------------------------------------------------------- 1 | main 2 | -------------------------------------------------------------------------------- /generate-stackbrew-library.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" 5 | 6 | declare -A aliases 7 | aliases=( 8 | [$(cat latest)]='latest' 9 | ) 10 | declare -A noVersion 11 | noVersion=( 12 | [oldstable]=1 13 | [stable]=1 14 | [testing]=1 15 | [unstable]=1 16 | [sid]=1 17 | ) 18 | 19 | versions=( */ ) 20 | versions=( "${versions[@]%/}" ) 21 | 22 | cat <<-EOH 23 | Maintainers: Tianon Gravi (@tianon), 24 | Paul Tagliamonte (@paultag) 25 | GitRepo: https://github.com/tianon/docker-brew-debian.git 26 | EOH 27 | 28 | branches=( dist-stable dist-unstable dist-oldstable master ) 29 | 30 | for branch in "${branches[@]}"; do 31 | if [ "$branch" = 'master' ]; then 32 | continue 33 | fi 34 | commitRange="master..$branch" 35 | commitCount="$(git rev-list "$commitRange" --count 2>/dev/null || true)" 36 | if [ "$commitCount" ] && [ "$commitCount" -gt 0 ]; then 37 | echo 38 | echo '# commits:' "($commitRange)" 39 | git log --format=format:'- %h %s%n%w(0,2,2)%b' "$commitRange" | sed 's/^/# /' 40 | fi 41 | done 42 | 43 | # prints "$2$1$3$1...$N" 44 | join() { 45 | local sep="$1"; shift 46 | local out; printf -v out "${sep//%/%%}%s" "$@" 47 | echo "${out#$sep}" 48 | } 49 | 50 | for version in "${versions[@]}"; do 51 | tarball="$version/rootfs.tar.xz" 52 | commit="$(git log -1 --format='format:%H' "${branches[@]}" -- "$tarball")" 53 | if [ -z "$commit" ]; then 54 | echo >&2 "warning: cannot determine commit for $tarball; skipping" 55 | continue 56 | fi 57 | branch= 58 | for b in "${branches[@]}"; do 59 | if git merge-base --is-ancestor "$commit" "$b" &> /dev/null; then 60 | branch="$b" 61 | break 62 | fi 63 | done 64 | if [ -z "$branch" ]; then 65 | echo >&2 "error: cannot determine branch for $tarball (commit $commit)" 66 | exit 1 67 | fi 68 | 69 | versionAliases=() 70 | if [ -z "${noVersion[$version]}" ]; then 71 | fullVersion="$(git show "$commit:$tarball" | tar -xvJ etc/debian_version --to-stdout 2>/dev/null || true)" 72 | if [ -z "$fullVersion" ] || [[ "$fullVersion" == */sid ]]; then 73 | fullVersion="$(eval "$(git show "$commit:$tarball" | tar -xvJ etc/os-release --to-stdout 2>/dev/null || true)" && echo "$VERSION" | cut -d' ' -f1)" 74 | if [ -z "$fullVersion" ]; then 75 | # lucid... 76 | fullVersion="$(eval "$(git show "$commit:$tarball" | tar -xvJ etc/lsb-release --to-stdout 2>/dev/null || true)" && echo "$DISTRIB_DESCRIPTION" | cut -d' ' -f2)" # DISTRIB_DESCRIPTION="Ubuntu 10.04.4 LTS" 77 | fi 78 | else 79 | while [ "${fullVersion%.*}" != "$fullVersion" ]; do 80 | versionAliases+=( $fullVersion ) 81 | fullVersion="${fullVersion%.*}" 82 | done 83 | fi 84 | if [ "$fullVersion" != "$version" ]; then 85 | versionAliases+=( $fullVersion ) 86 | fi 87 | fi 88 | versionAliases+=( $version $(git show "$commit:$version/suite" 2>/dev/null || true) ${aliases[$version]} ) 89 | 90 | echo 91 | cat <<-EOE 92 | Tags: $(join ', ' "${versionAliases[@]}") 93 | GitFetch: refs/heads/$branch 94 | GitCommit: $commit 95 | Directory: $version 96 | EOE 97 | 98 | for imageVariant in slim backports; do 99 | if [ "$(git show "$commit:$version/$imageVariant/Dockerfile" 2>/dev/null || true)" ]; then 100 | echo 101 | cat <<-EOE 102 | Tags: $version-$imageVariant 103 | GitFetch: refs/heads/$branch 104 | GitCommit: $commit 105 | Directory: $version/$imageVariant 106 | EOE 107 | fi 108 | done 109 | done 110 | 111 | dockerfilesBase='https://github.com/tianon/dockerfiles' 112 | dockerfilesGit="$dockerfilesBase.git" 113 | dockerfilesBranch='master' 114 | dockerfiles="$dockerfilesBase/commits/$dockerfilesBranch/debian" 115 | 116 | rcBuggyCommit="$(curl -fsSL "$dockerfiles/rc-buggy/Dockerfile.atom" | tac|tac | awk -F '[ \t]*[<>/]+' '$2 == "id" && $3 ~ /Commit/ { print $4; exit }')" 117 | experimentalCommit="$(curl -fsSL "$dockerfiles/experimental/Dockerfile.atom" | tac|tac | awk -F '[ \t]*[<>/]+' '$2 == "id" && $3 ~ /Commit/ { print $4; exit }')" 118 | 119 | cat <<-EOE 120 | 121 | # sid + rc-buggy 122 | Tags: rc-buggy 123 | GitRepo: $dockerfilesGit 124 | GitFetch: refs/heads/$dockerfilesBranch 125 | GitCommit: $rcBuggyCommit 126 | Directory: debian/rc-buggy 127 | 128 | # unstable + experimental 129 | Tags: experimental 130 | GitRepo: $dockerfilesGit 131 | GitFetch: refs/heads/$dockerfilesBranch 132 | GitCommit: $experimentalCommit 133 | Directory: debian/experimental 134 | EOE 135 | -------------------------------------------------------------------------------- /jessie/include: -------------------------------------------------------------------------------- 1 | inetutils-ping,iproute2 2 | -------------------------------------------------------------------------------- /latest: -------------------------------------------------------------------------------- 1 | jessie 2 | -------------------------------------------------------------------------------- /mirror: -------------------------------------------------------------------------------- 1 | http://deb.debian.org/debian 2 | -------------------------------------------------------------------------------- /mkimage.sh: -------------------------------------------------------------------------------- 1 | /home/tianon/docker/docker/contrib/mkimage.sh -------------------------------------------------------------------------------- /oldstable/include: -------------------------------------------------------------------------------- 1 | inetutils-ping,iproute 2 | -------------------------------------------------------------------------------- /repo: -------------------------------------------------------------------------------- 1 | debian 2 | -------------------------------------------------------------------------------- /sid/include: -------------------------------------------------------------------------------- 1 | inetutils-ping,iproute2 2 | -------------------------------------------------------------------------------- /sid/merged-usr: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /slim-excludes: -------------------------------------------------------------------------------- 1 | # This file contains the list of files/directories which will be removed for the "slim" image variants. 2 | # https://github.com/tianon/docker-brew-debian/issues/48 3 | # https://wiki.ubuntu.com/ReducingDiskFootprint#Drop_unnecessary_files 4 | /usr/share/doc/* 5 | /usr/share/groff/* 6 | /usr/share/info/* 7 | /usr/share/linda/* 8 | /usr/share/lintian/* 9 | /usr/share/locale/* 10 | /usr/share/man/* 11 | -------------------------------------------------------------------------------- /stable/include: -------------------------------------------------------------------------------- 1 | inetutils-ping,iproute 2 | -------------------------------------------------------------------------------- /stretch/include: -------------------------------------------------------------------------------- 1 | inetutils-ping,iproute2 2 | -------------------------------------------------------------------------------- /stretch/merged-usr: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /testing/include: -------------------------------------------------------------------------------- 1 | inetutils-ping,iproute2 2 | -------------------------------------------------------------------------------- /testing/merged-usr: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /unstable/include: -------------------------------------------------------------------------------- 1 | inetutils-ping,iproute2 2 | -------------------------------------------------------------------------------- /unstable/merged-usr: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | cd "$(readlink -f "$(dirname "$BASH_SOURCE")")" 5 | 6 | get_part() { 7 | dir="$1" 8 | shift 9 | part="$1" 10 | shift 11 | if [ -f "$dir/$part" ]; then 12 | cat "$dir/$part" 13 | return 0 14 | fi 15 | if [ -f "$part" ]; then 16 | cat "$part" 17 | return 0 18 | fi 19 | if [ $# -gt 0 ]; then 20 | echo "$1" 21 | return 0 22 | fi 23 | return 1 24 | } 25 | 26 | declare -A codenameCache=() 27 | codename() { 28 | local suite="$1"; shift 29 | if [ -z "${codenameCache[$suite]}" ]; then 30 | local mirror="$(get_part "$suite" mirror '')" 31 | local ret="$(curl -fsSL "$mirror/dists/$suite/Release" | awk -F ': ' '$1 == "Codename" { print $2 }' || true)" 32 | codenameCache[$suite]="${ret:-$suite}" 33 | fi 34 | echo "${codenameCache[$suite]}" 35 | } 36 | 37 | declare -A backports=( 38 | [stable]=1 39 | [oldstable]=1 40 | [$(codename stable)]=1 41 | [$(codename oldstable)]=1 42 | ) 43 | 44 | declare -A unstableSuites=( 45 | [unstable]=1 46 | [testing]=1 47 | [$(codename unstable)]=1 48 | [$(codename testing)]=1 49 | ) 50 | declare -A stableSuites=( 51 | [stable]=1 52 | [$(codename stable)]=1 53 | ) 54 | 55 | versions=( "$@" ) 56 | if [ ${#versions[@]} -eq 0 ]; then 57 | branch="$(git describe --contains --all HEAD)" 58 | case "$branch" in 59 | dist-oldstable) 60 | for suite in */; do 61 | suite="${suite%/}" 62 | [ -z "${stableSuites[$suite]}" ] || continue 63 | [ -z "${unstableSuites[$suite]}" ] || continue 64 | versions+=( "$suite" ) 65 | done 66 | ;; 67 | dist-stable) 68 | for suite in "${!stableSuites[@]}"; do 69 | if [ -d "$suite" ]; then 70 | versions+=( "$suite" ) 71 | fi 72 | done 73 | ;; 74 | dist-unstable) 75 | for suite in "${!unstableSuites[@]}"; do 76 | if [ -d "$suite" ]; then 77 | versions+=( "$suite" ) 78 | fi 79 | done 80 | ;; 81 | *) 82 | versions=( */ ) 83 | ;; 84 | esac 85 | fi 86 | versions=( "${versions[@]%/}" ) 87 | 88 | repo="$(get_part . repo '')" 89 | if [ "$repo" ]; then 90 | origRepo="$repo" 91 | if [[ "$repo" != */* ]]; then 92 | user="$(docker info | awk '/^Username:/ { print $2 }')" 93 | if [ "$user" ]; then 94 | repo="$user/$repo" 95 | fi 96 | fi 97 | fi 98 | 99 | latest="$(get_part . latest '')" 100 | for version in "${versions[@]}"; do 101 | dir="$(readlink -f "$version")" 102 | variant="$(get_part "$dir" variant 'minbase')" 103 | components="$(get_part "$dir" components 'main')" 104 | include="$(get_part "$dir" include '')" 105 | arch="$(get_part "$dir" arch '')" 106 | mergedUsr="$(get_part "$dir" merged-usr '')" 107 | suite="$(get_part "$dir" suite "$version")" 108 | mirror="$(get_part "$dir" mirror '')" 109 | script="$(get_part "$dir" script '')" 110 | 111 | args=( --dir "$dir" --compression 'xz' debootstrap ) 112 | [ -z "$variant" ] || args+=( --variant="$variant" ) 113 | [ -z "$components" ] || args+=( --components="$components" ) 114 | [ -z "$include" ] || args+=( --include="$include" ) 115 | [ -z "$arch" ] || args+=( --arch="$arch" ) 116 | 117 | debootstrapVersion="$(debootstrap --version)" 118 | debootstrapVersion="${debootstrapVersion##* }" 119 | if dpkg --compare-versions "$debootstrapVersion" '>=' '1.0.69'; then 120 | args+=( --force-check-gpg ) 121 | fi 122 | 123 | if [ "$mergedUsr" ]; then 124 | # --merged-usr was introduced in debootstrap 1.0.83 125 | if dpkg --compare-versions "$debootstrapVersion" '>=' '1.0.83'; then 126 | args+=( --merged-usr ) 127 | else 128 | echo >&2 129 | echo >&2 "warning: --merged-usr was added in debootstrap 1.0.83" 130 | echo >&2 " only $debootstrapVersion was found, so request for merged-usr is being ignored" 131 | echo >&2 132 | fi 133 | fi 134 | 135 | args+=( "$suite" ) 136 | if [ "$mirror" ]; then 137 | args+=( "$mirror" ) 138 | if [ "$script" ]; then 139 | args+=( "$script" ) 140 | fi 141 | fi 142 | 143 | mkimage="$(readlink -f "${MKIMAGE:-"mkimage.sh"}")" 144 | { 145 | echo "$(basename "$mkimage") ${args[*]/"$dir"/.}" 146 | echo 147 | echo 'https://github.com/docker/docker/blob/master/contrib/mkimage.sh' 148 | } > "$dir/build-command.txt" 149 | 150 | sudo rm -rf "$dir/rootfs" 151 | sudo nice ionice -c 3 "$mkimage" "${args[@]}" 2>&1 | tee "$dir/build.log" 152 | 153 | sudo chown -R "$(id -u):$(id -g)" "$dir" 154 | 155 | if [ "$repo" ]; then 156 | ( set -x && docker build -t "${repo}:${suite}" "$dir" ) 157 | if [ "$suite" != "$version" ]; then 158 | ( set -x && docker tag "${repo}:${suite}" "${repo}:${version}" ) 159 | fi 160 | if [ "$suite" = "$latest" ]; then 161 | ( set -x && docker tag "$repo:$suite" "$repo:latest" ) 162 | fi 163 | docker run --rm "${repo}:${suite}" bash -xc ' 164 | cat /etc/apt/sources.list 165 | echo 166 | cat /etc/os-release 2>/dev/null 167 | echo 168 | cat /etc/lsb-release 2>/dev/null 169 | echo 170 | cat /etc/debian_version 2>/dev/null 171 | true 172 | ' 173 | docker run --rm "${repo}:${suite}" dpkg-query -f '${Package}\t${Version}\n' -W > "$dir/build.manifest" 174 | fi 175 | 176 | if [ "${backports[$suite]}" ]; then 177 | mkdir -p "$dir/backports" 178 | echo "FROM $origRepo:$suite" > "$dir/backports/Dockerfile" 179 | cat >> "$dir/backports/Dockerfile" <<-'EOF' 180 | RUN awk '$1 ~ "^deb" { $3 = $3 "-backports"; print; exit }' /etc/apt/sources.list > /etc/apt/sources.list.d/backports.list 181 | EOF 182 | 183 | if [ "$repo" ]; then 184 | ( set -x && docker build -t "${repo}:${suite}-backports" "$dir/backports" ) 185 | fi 186 | fi 187 | 188 | IFS=$'\n' 189 | set -o noglob 190 | slimExcludes=( $(get_part "$dir" slim-excludes '' | grep -vE '^#|^$') ) 191 | set +o noglob 192 | unset IFS 193 | if [ "${#slimExcludes[@]}" -gt 0 ]; then 194 | sudo rm -rf "$dir/slim/rootfs" 195 | mkdir -p "$dir/slim/rootfs" 196 | sudo tar --extract --file "$dir/rootfs.tar.xz" --directory "$dir/slim/rootfs" 197 | 198 | dpkgCfgFile="$dir/slim/rootfs/etc/dpkg/dpkg.cfg.d/docker" 199 | sudo mkdir -p "$(dirname "$dpkgCfgFile")" 200 | { 201 | echo '# This is the "slim" variant of the Debian base image.' 202 | echo '# Many files which are normally unnecessary in containers are excluded,' 203 | echo '# and this configuration file keeps them that way.' 204 | } | sudo tee -a "$dpkgCfgFile" 205 | 206 | neverExclude='/usr/share/doc/*/copyright' 207 | for slimExclude in "${slimExcludes[@]}"; do 208 | { 209 | echo 210 | echo "# dpkg -S '$slimExclude'" 211 | if dpkgOutput="$(sudo chroot "$dir/slim/rootfs" dpkg -S "$slimExclude" 2>&1)"; then 212 | echo "$dpkgOutput" | sed 's/: .*//g; s/, /\n/g' | sort -u | xargs 213 | else 214 | echo "$dpkgOutput" 215 | fi | fold -w 76 -s | sed 's/^/# /' 216 | echo "path-exclude $slimExclude" 217 | } | sudo tee -a "$dpkgCfgFile" 218 | if [[ "$slimExclude" == *'/*' ]]; then 219 | if [ -d "$dir/slim/rootfs/$(dirname "$slimExclude")" ]; then 220 | # use two passes so that we don't fail trying to remove directories from $neverExclude 221 | sudo chroot "$dir/slim/rootfs" \ 222 | find "$(dirname "$slimExclude")" \ 223 | -mindepth 1 \ 224 | -not -path "$neverExclude" \ 225 | -not -type d \ 226 | -delete 227 | sudo chroot "$dir/slim/rootfs" \ 228 | find "$(dirname "$slimExclude")" \ 229 | -mindepth 1 \ 230 | -empty \ 231 | -delete 232 | fi 233 | else 234 | sudo chroot "$dir/slim/rootfs" rm -f "$slimExclude" 235 | fi 236 | done 237 | { 238 | echo 239 | echo '# always include these files, especially for license compliance' 240 | echo "path-include $neverExclude" 241 | } | sudo tee -a "$dpkgCfgFile" 242 | 243 | sudo tar --numeric-owner --create --auto-compress --file "$dir/slim/rootfs.tar.xz" --directory "$dir/slim/rootfs" --transform='s,^./,,' . 244 | sudo rm -rf "$dir/slim/rootfs" 245 | cp "$dir/Dockerfile" "$dir/slim/" 246 | 247 | sudo chown -R "$(id -u):$(id -g)" "$dir/slim" 248 | 249 | ls -lh "$dir/rootfs.tar.xz" "$dir/slim/rootfs.tar.xz" 250 | 251 | if [ "$repo" ]; then 252 | ( set -x && docker build -t "${repo}:${suite}-slim" "$dir/slim" ) 253 | docker images "${repo}:${suite}" | tail -1 254 | docker images "${repo}:${suite}-slim" | tail -1 255 | fi 256 | fi 257 | 258 | find "$dir" \ 259 | \( \ 260 | -name '*.txt' \ 261 | -or -name '*.log' \ 262 | \) \ 263 | -exec sed -i \ 264 | -e 's!'"$PWD"'!/«BREWDIR»!g' \ 265 | -e 's!'"$(dirname "$mkimage")"'!/«MKIMAGEDIR»!g' \ 266 | '{}' + 267 | done 268 | -------------------------------------------------------------------------------- /wheezy/include: -------------------------------------------------------------------------------- 1 | inetutils-ping,iproute 2 | --------------------------------------------------------------------------------