Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 3.7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:jessie-slim
FROM ubuntu:xenial

# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r mongodb && useradd -r -g mongodb mongodb
Expand Down Expand Up @@ -66,7 +66,7 @@ ENV MONGO_PACKAGE=${MONGO_PACKAGE} MONGO_REPO=${MONGO_REPO}
ENV MONGO_MAJOR 3.7
ENV MONGO_VERSION 3.7.9

RUN echo "deb http://$MONGO_REPO/apt/debian jessie/${MONGO_PACKAGE%-unstable}/$MONGO_MAJOR main" | tee "/etc/apt/sources.list.d/${MONGO_PACKAGE%-unstable}.list"
RUN echo "deb http://$MONGO_REPO/apt/ubuntu xenial/${MONGO_PACKAGE%-unstable}/$MONGO_MAJOR multiverse" | tee "/etc/apt/sources.list.d/${MONGO_PACKAGE%-unstable}.list"

RUN set -x \
&& apt-get update \
Expand Down
4 changes: 2 additions & 2 deletions 4.0-rc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:jessie-slim
FROM ubuntu:xenial

# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r mongodb && useradd -r -g mongodb mongodb
Expand Down Expand Up @@ -66,7 +66,7 @@ ENV MONGO_PACKAGE=${MONGO_PACKAGE} MONGO_REPO=${MONGO_REPO}
ENV MONGO_MAJOR testing
ENV MONGO_VERSION 4.0.0~rc0

RUN echo "deb http://$MONGO_REPO/apt/debian jessie/${MONGO_PACKAGE%-unstable}/$MONGO_MAJOR main" | tee "/etc/apt/sources.list.d/${MONGO_PACKAGE%-unstable}.list"
RUN echo "deb http://$MONGO_REPO/apt/ubuntu xenial/${MONGO_PACKAGE%-unstable}/$MONGO_MAJOR multiverse" | tee "/etc/apt/sources.list.d/${MONGO_PACKAGE%-unstable}.list"

RUN set -x \
&& apt-get update \
Expand Down
24 changes: 20 additions & 4 deletions generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,34 @@ for version in "${versions[@]}"; do
${aliases[$version]:-}
)

variant="$(git show "$commit":"$version/Dockerfile" | awk '$1 == "FROM" { gsub(/^.*:|-.*$/, "", $2); print $2; exit }')"
from="$(git show "$commit":"$version/Dockerfile" | awk '$1 == "FROM" { print $2; exit }')"
distro="${from%%:*}" # "debian", "ubuntu"
suite="${from#$distro:}" # "jessie-slim", "xenial"
suite="${suite%-slim}" # "jessie", "xenial"

component='multiverse'
if [ "$distro" = 'debian' ]; then
component='main'
fi

variant="$suite"
variantAliases=( "${versionAliases[@]/%/-$variant}" )
variantAliases=( "${variantAliases[@]//latest-/}" )

major="$(git show "$commit":"$version/Dockerfile" | awk '$1 == "ENV" && $2 == "MONGO_MAJOR" { print $3 }')"

variantArches=( amd64 )
if [ "$distro" = 'ubuntu' ]; then
variantArches+=( arm64v8 )
fi

echo
cat <<-EOE
Tags: $(join ', ' "${variantAliases[@]}")
SharedTags: $(join ', ' "${versionAliases[@]}")
# see http://repo.mongodb.org/apt/debian/dists/$variant/mongodb-org/${version}/main/
# (i386 is empty, as is ppc64el)
Architectures: amd64
# see http://repo.mongodb.org/apt/$distro/dists/$suite/mongodb-org/$major/$component/
# (i386, ppc64el, s390x are empty)
Architectures: $(join ', ' "${variantArches[@]}")
GitCommit: $commit
Directory: $version
EOE
Expand Down
12 changes: 9 additions & 3 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@ for version in "${versions[@]}"; do
fi

from="$(gawk -F '[[:space:]]+' 'toupper($1) == "FROM" { print $2; exit }' "$version/Dockerfile")" # "debian:xxx"
suite="${from#*:}" # "wheezy-slim" or "jessie-slim"
suite="${suite%-slim}" # "wheezy" or "jessie"
distro="${from%%:*}" # "debian", "ubuntu"
suite="${from#$distro:}" # "jessie-slim", "xenial"
suite="${suite%-slim}" # "jessie", "xenial"

packagesUrl="https://repo.mongodb.org/apt/debian/dists/$suite/mongodb-org/$major/main/binary-amd64/Packages"
component='multiverse'
if [ "$distro" = 'debian' ]; then
component='main'
fi

packagesUrl="https://repo.mongodb.org/apt/$distro/dists/$suite/mongodb-org/$major/$component/binary-amd64/Packages"
fullVersion="$(
curl -fsSL "$packagesUrl.gz" \
| gunzip \
Expand Down