-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PSMDB-1345. Add dockerfile for PSMDB 7.0
- Loading branch information
1 parent
565f49b
commit 3b00a75
Showing
10 changed files
with
1,342 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
FROM oraclelinux:8 | ||
|
||
LABEL org.opencontainers.image.authors="[email protected]" | ||
|
||
# check repository package signature in secure way | ||
RUN set -ex; \ | ||
export GNUPGHOME="$(mktemp -d)"; \ | ||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A 99DB70FAE1D7CE227FB6488205B555B38483C65D 94E279EB8D8F25B21810ADF121EA45AB2F86D6A1; \ | ||
gpg --batch --export --armor 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A > ${GNUPGHOME}/RPM-GPG-KEY-Percona; \ | ||
gpg --batch --export --armor 99DB70FAE1D7CE227FB6488205B555B38483C65D > ${GNUPGHOME}/RPM-GPG-KEY-centosofficial; \ | ||
gpg --batch --export --armor 94E279EB8D8F25B21810ADF121EA45AB2F86D6A1 > ${GNUPGHOME}/RPM-GPG-KEY-EPEL-8; \ | ||
rpmkeys --import ${GNUPGHOME}/RPM-GPG-KEY-Percona ${GNUPGHOME}/RPM-GPG-KEY-centosofficial ${GNUPGHOME}/RPM-GPG-KEY-EPEL-8; \ | ||
curl -Lf -o /tmp/percona-release.rpm https://repo.percona.com/yum/percona-release-latest.noarch.rpm; \ | ||
rpmkeys --checksig /tmp/percona-release.rpm; \ | ||
rpm -i /tmp/percona-release.rpm; \ | ||
rm -rf "$GNUPGHOME" /tmp/percona-release.rpm; \ | ||
rpm --import /etc/pki/rpm-gpg/PERCONA-PACKAGING-KEY | ||
|
||
ENV PSMDB_VERSION 7.0.2-1 | ||
ENV OS_VER el8 | ||
ENV FULL_PERCONA_VERSION "$PSMDB_VERSION.$OS_VER" | ||
ENV K8S_TOOLS_VERSION "0.5.0" | ||
ENV PSMDB_REPO release | ||
|
||
RUN set -ex; \ | ||
percona-release enable psmdb-70 ${PSMDB_REPO}; \ | ||
dnf config-manager --enable ol8_u4_security_validation; \ | ||
dnf -y update openssh; \ | ||
dnf -y install \ | ||
percona-server-mongodb-mongos-${FULL_PERCONA_VERSION} \ | ||
percona-server-mongodb-tools-${FULL_PERCONA_VERSION} \ | ||
percona-mongodb-mongosh \ | ||
procps-ng \ | ||
jq \ | ||
tar \ | ||
oniguruma \ | ||
cyrus-sasl-gssapi \ | ||
policycoreutils; \ | ||
\ | ||
curl -Lf -o /tmp/Percona-Server-MongoDB-server.rpm http://repo.percona.com/psmdb-70/yum/${PSMDB_REPO}/8/RPMS/x86_64/percona-server-mongodb-server-${FULL_PERCONA_VERSION}.x86_64.rpm; \ | ||
rpmkeys --checksig /tmp/Percona-Server-MongoDB-server.rpm; \ | ||
rpm -iv /tmp/Percona-Server-MongoDB-server.rpm --nodeps; \ | ||
rm -rf /tmp/Percona-Server-MongoDB-server.rpm; \ | ||
dnf clean all; \ | ||
rm -rf /var/cache/dnf /var/cache/yum /data/db && mkdir -p /data/db; \ | ||
chown -R 1001:0 /data/db | ||
|
||
# the numeric UID is needed for OpenShift | ||
RUN useradd -u 1001 -r -g 0 -m -s /sbin/nologin \ | ||
-c "Default Application User" mongodb; \ | ||
chmod g+rwx /var/log/mongo; \ | ||
chown :0 /var/log/mongo | ||
|
||
COPY LICENSE /licenses/LICENSE.Dockerfile | ||
RUN cp /usr/share/doc/percona-server-mongodb-server/LICENSE-Community.txt /licenses/LICENSE.Percona-Server-for-MongoDB | ||
|
||
ENV GOSU_VERSION=1.11 | ||
RUN set -eux; \ | ||
curl -Lf -o /usr/bin/gosu https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64; \ | ||
curl -Lf -o /usr/bin/gosu.asc https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64.asc; \ | ||
\ | ||
export GNUPGHOME="$(mktemp -d)"; \ | ||
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ | ||
gpg --batch --verify /usr/bin/gosu.asc /usr/bin/gosu; \ | ||
rm -rf "$GNUPGHOME" /usr/bin/gosu.asc; \ | ||
\ | ||
chmod +x /usr/bin/gosu; \ | ||
curl -f -o /licenses/LICENSE.gosu https://raw.githubusercontent.com/tianon/gosu/${GOSU_VERSION}/LICENSE | ||
|
||
RUN set -ex; \ | ||
curl -fSL https://github.com/percona/mongodb-orchestration-tools/releases/download/${K8S_TOOLS_VERSION}/k8s-mongodb-initiator -o /usr/local/bin/k8s-mongodb-initiator; \ | ||
curl -fSL https://github.com/percona/mongodb-orchestration-tools/releases/download/${K8S_TOOLS_VERSION}/mongodb-healthcheck -o /usr/local/bin/mongodb-healthcheck; \ | ||
curl -fSL https://github.com/percona/mongodb-orchestration-tools/releases/download/${K8S_TOOLS_VERSION}/SHA256SUMS -o /tmp/SHA256SUMS; \ | ||
echo "$(grep 'k8s-mongodb-initiator' /tmp/SHA256SUMS | awk '{print $1}')" /usr/local/bin/k8s-mongodb-initiator | sha256sum -c -; \ | ||
echo "$(grep 'mongodb-healthcheck' /tmp/SHA256SUMS | awk '{print $1}')" /usr/local/bin/mongodb-healthcheck | sha256sum -c -; \ | ||
rm -f /tmp/SHA256SUMS; \ | ||
\ | ||
chmod 0755 /usr/local/bin/k8s-mongodb-initiator /usr/local/bin/mongodb-healthcheck | ||
|
||
VOLUME ["/data/db"] | ||
|
||
RUN set -ex; \ | ||
curl -fSL https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.1.0/js-yaml.min.js -o /js-yaml.js; \ | ||
echo "45dc3dd03dc07a06705a2c2989b8c7f709013f04bd5386e3279d4e447f07ebd7 /js-yaml.js" | sha256sum -c - | ||
|
||
COPY ps-entry.sh /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
EXPOSE 27017 | ||
|
||
USER 1001 | ||
|
||
CMD ["mongod"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
FROM oraclelinux:8 | ||
|
||
LABEL org.opencontainers.image.authors="[email protected]" | ||
|
||
# check repository package signature in secure way | ||
RUN set -ex; \ | ||
export GNUPGHOME="$(mktemp -d)"; \ | ||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A 99DB70FAE1D7CE227FB6488205B555B38483C65D 94E279EB8D8F25B21810ADF121EA45AB2F86D6A1; \ | ||
gpg --batch --export --armor 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A > ${GNUPGHOME}/RPM-GPG-KEY-Percona; \ | ||
gpg --batch --export --armor 99DB70FAE1D7CE227FB6488205B555B38483C65D > ${GNUPGHOME}/RPM-GPG-KEY-centosofficial; \ | ||
gpg --batch --export --armor 94E279EB8D8F25B21810ADF121EA45AB2F86D6A1 > ${GNUPGHOME}/RPM-GPG-KEY-EPEL-8; \ | ||
rpmkeys --import ${GNUPGHOME}/RPM-GPG-KEY-Percona ${GNUPGHOME}/RPM-GPG-KEY-centosofficial ${GNUPGHOME}/RPM-GPG-KEY-EPEL-8; \ | ||
curl -Lf -o /tmp/percona-release.rpm https://repo.percona.com/yum/percona-release-latest.noarch.rpm; \ | ||
rpmkeys --checksig /tmp/percona-release.rpm; \ | ||
rpm -i /tmp/percona-release.rpm; \ | ||
rm -rf "$GNUPGHOME" /tmp/percona-release.rpm; \ | ||
rpm --import /etc/pki/rpm-gpg/PERCONA-PACKAGING-KEY | ||
|
||
ENV PSMDB_VERSION 7.0.2-1 | ||
ENV OS_VER el8 | ||
ENV FULL_PERCONA_VERSION "$PSMDB_VERSION.$OS_VER" | ||
ENV K8S_TOOLS_VERSION "0.5.0" | ||
ENV PSMDB_REPO experimental | ||
|
||
RUN set -ex; \ | ||
sed -i "s|x86_64|x86_64 aarch64|" /usr/bin/percona-release; \ | ||
percona-release enable psmdb-70 ${PSMDB_REPO}; \ | ||
dnf config-manager --enable ol8_u4_security_validation; \ | ||
dnf -y update openssh; \ | ||
dnf -y install \ | ||
percona-server-mongodb-mongos-${FULL_PERCONA_VERSION} \ | ||
percona-server-mongodb-tools-${FULL_PERCONA_VERSION} \ | ||
percona-mongodb-mongosh \ | ||
procps-ng \ | ||
jq \ | ||
tar \ | ||
oniguruma \ | ||
cyrus-sasl-gssapi \ | ||
policycoreutils; \ | ||
\ | ||
ARCH="$(uname -m)"; \ | ||
curl -Lf -o /tmp/Percona-Server-MongoDB-server.rpm http://repo.percona.com/psmdb-70/yum/${PSMDB_REPO}/8/RPMS/${ARCH}/percona-server-mongodb-server-${FULL_PERCONA_VERSION}.${ARCH}.rpm; \ | ||
rpmkeys --checksig /tmp/Percona-Server-MongoDB-server.rpm; \ | ||
rpm -iv /tmp/Percona-Server-MongoDB-server.rpm --nodeps; \ | ||
rm -rf /tmp/Percona-Server-MongoDB-server.rpm; \ | ||
dnf clean all; \ | ||
rm -rf /var/cache/dnf /var/cache/yum /data/db && mkdir -p /data/db; \ | ||
chown -R 1001:0 /data/db | ||
|
||
# the numeric UID is needed for OpenShift | ||
RUN useradd -u 1001 -r -g 0 -m -s /sbin/nologin \ | ||
-c "Default Application User" mongodb; \ | ||
chmod g+rwx /var/log/mongo; \ | ||
chown :0 /var/log/mongo | ||
|
||
COPY LICENSE /licenses/LICENSE.Dockerfile | ||
RUN cp /usr/share/doc/percona-server-mongodb-server/LICENSE-Community.txt /licenses/LICENSE.Percona-Server-for-MongoDB | ||
|
||
ENV GOSU_VERSION=1.11 | ||
RUN set -eux; \ | ||
ARCH="$(uname -m)"; \ | ||
case "${ARCH}" in \ | ||
aarch64 ) \ | ||
GOSU_ARCH="arm64"; \ | ||
;; \ | ||
x86_64 ) \ | ||
GOSU_ARCH="amd64"; \ | ||
;; \ | ||
esac; \ | ||
curl -Lf -o /usr/bin/gosu https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${GOSU_ARCH}; \ | ||
curl -Lf -o /usr/bin/gosu.asc https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${GOSU_ARCH}.asc; \ | ||
\ | ||
export GNUPGHOME="$(mktemp -d)"; \ | ||
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ | ||
gpg --batch --verify /usr/bin/gosu.asc /usr/bin/gosu; \ | ||
rm -rf "$GNUPGHOME" /usr/bin/gosu.asc; \ | ||
\ | ||
chmod +x /usr/bin/gosu; \ | ||
curl -f -o /licenses/LICENSE.gosu https://raw.githubusercontent.com/tianon/gosu/${GOSU_VERSION}/LICENSE | ||
|
||
RUN set -ex; \ | ||
curl -fSL https://github.com/percona/mongodb-orchestration-tools/releases/download/${K8S_TOOLS_VERSION}/k8s-mongodb-initiator -o /usr/local/bin/k8s-mongodb-initiator; \ | ||
curl -fSL https://github.com/percona/mongodb-orchestration-tools/releases/download/${K8S_TOOLS_VERSION}/mongodb-healthcheck -o /usr/local/bin/mongodb-healthcheck; \ | ||
curl -fSL https://github.com/percona/mongodb-orchestration-tools/releases/download/${K8S_TOOLS_VERSION}/SHA256SUMS -o /tmp/SHA256SUMS; \ | ||
echo "$(grep 'k8s-mongodb-initiator' /tmp/SHA256SUMS | awk '{print $1}')" /usr/local/bin/k8s-mongodb-initiator | sha256sum -c -; \ | ||
echo "$(grep 'mongodb-healthcheck' /tmp/SHA256SUMS | awk '{print $1}')" /usr/local/bin/mongodb-healthcheck | sha256sum -c -; \ | ||
rm -f /tmp/SHA256SUMS; \ | ||
\ | ||
chmod 0755 /usr/local/bin/k8s-mongodb-initiator /usr/local/bin/mongodb-healthcheck | ||
|
||
VOLUME ["/data/db"] | ||
|
||
RUN set -ex; \ | ||
curl -fSL https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.1.0/js-yaml.min.js -o /js-yaml.js; \ | ||
echo "45dc3dd03dc07a06705a2c2989b8c7f709013f04bd5386e3279d4e447f07ebd7 /js-yaml.js" | sha256sum -c - | ||
|
||
COPY ps-entry.sh /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
EXPOSE 27017 | ||
|
||
USER 1001 | ||
|
||
CMD ["mongod"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
FROM percona/percona-server-mongodb:7.0 | ||
|
||
LABEL org.label-schema.schema-version="1.0" | ||
LABEL org.label-schema.name="Percona Server for MongoDB" | ||
LABEL org.label-schema.vendor="Percona" | ||
LABEL org.label-schema.description="Percona Server for MongoDB is our free and \ | ||
open-source drop-in replacement for MongoDB Community Edition. \ | ||
It offers all the features and benefits of MongoDB Community Edition, \ | ||
plus additional enterprise-grade functionality." | ||
LABEL org.label-schema.license="SSPLv1" | ||
|
||
LABEL org.opencontainers.image.title="Percona Server for MongoDB" | ||
LABEL org.opencontainers.image.vendor="Percona" | ||
LABEL org.opencontainers.image.description="Percona Server for MongoDB is our free and \ | ||
open-source drop-in replacement for MongoDB Community Edition. \ | ||
It offers all the features and benefits of MongoDB Community Edition, \ | ||
plus additional enterprise-grade functionality." | ||
LABEL org.opencontainers.image.license="SSPLv1" | ||
LABEL org.opencontainers.image.authors="[email protected]" | ||
|
||
LABEL org.label-schema.schema-version=${PSMDB_VERSION} | ||
LABEL org.opencontainers.image.version=${PSMDB_VERSION} | ||
|
||
USER 0 | ||
|
||
RUN set -ex; \ | ||
sed -i 's/exec "$@"/exec "$@" -vvv || sleep infinity/' /entrypoint.sh; \ | ||
dnf -y install \ | ||
net-tools \ | ||
gdb \ | ||
nc \ | ||
telnet \ | ||
cyrus-sasl-gssapi \ | ||
percona-server-mongodb-server-debuginfo-${FULL_PERCONA_VERSION} \ | ||
percona-server-mongodb-tools-debuginfo-${FULL_PERCONA_VERSION} \ | ||
percona-server-mongodb-mongos-debuginfo-${FULL_PERCONA_VERSION} \ | ||
percona-server-mongodb-debugsource-${FULL_PERCONA_VERSION} \ | ||
percona-server-mongodb-tools-${FULL_PERCONA_VERSION}; \ | ||
dnf clean all; \ | ||
rm -rf /var/cache/dnf /var/cache/yum | ||
|
||
VOLUME ["/data/db"] | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
EXPOSE 27017 | ||
|
||
USER 1001 | ||
|
||
CMD ["mongod"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
FROM redhat/ubi8-minimal | ||
|
||
# Please don't remove old-style LABEL since it's needed for RedHat certification | ||
LABEL name="Percona Server for MongoDB" \ | ||
release="7.0" \ | ||
vendor="Percona" \ | ||
summary="Percona Server for MongoDB is our free and open-source drop-in replacement for MongoDB Community Edition" \ | ||
description="Percona Server for MongoDB is our free and open-source drop-in replacement for MongoDB Community Edition. It offers all the features and benefits of MongoDB Community Edition, plus additional enterprise-grade functionality." \ | ||
maintainer="Percona Development <[email protected]>" | ||
LABEL org.label-schema.license="SSPLv1" | ||
|
||
LABEL org.opencontainers.image.title="Percona Server for MongoDB" | ||
LABEL org.opencontainers.image.vendor="Percona" | ||
LABEL org.opencontainers.image.description="Percona Server for MongoDB is our free and \ | ||
open-source drop-in replacement for MongoDB Community Edition. \ | ||
It offers all the features and benefits of MongoDB Community Edition, \ | ||
plus additional enterprise-grade functionality." | ||
LABEL org.opencontainers.image.license="SSPLv1" | ||
LABEL org.opencontainers.image.authors="[email protected]" | ||
|
||
ENV PSMDB_VERSION 7.0.2-1 | ||
ENV OS_VER el8 | ||
ENV FULL_PERCONA_VERSION "$PSMDB_VERSION.$OS_VER" | ||
ENV K8S_TOOLS_VERSION "0.5.0" | ||
ENV PSMDB_REPO release | ||
LABEL org.label-schema.schema-version=${PSMDB_VERSION} | ||
LABEL org.opencontainers.image.version=${PSMDB_VERSION} | ||
|
||
# check repository package signature in secure way | ||
RUN set -ex; \ | ||
export GNUPGHOME="$(mktemp -d)"; \ | ||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A 99DB70FAE1D7CE227FB6488205B555B38483C65D 94E279EB8D8F25B21810ADF121EA45AB2F86D6A1; \ | ||
gpg --batch --export --armor 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A > ${GNUPGHOME}/RPM-GPG-KEY-Percona; \ | ||
gpg --batch --export --armor 99DB70FAE1D7CE227FB6488205B555B38483C65D > ${GNUPGHOME}/RPM-GPG-KEY-centosofficial; \ | ||
gpg --batch --export --armor 94E279EB8D8F25B21810ADF121EA45AB2F86D6A1 > ${GNUPGHOME}/RPM-GPG-KEY-EPEL-8; \ | ||
rpmkeys --import ${GNUPGHOME}/RPM-GPG-KEY-Percona ${GNUPGHOME}/RPM-GPG-KEY-centosofficial ${GNUPGHOME}/RPM-GPG-KEY-EPEL-8; \ | ||
microdnf install -y findutils; \ | ||
curl -Lf -o /tmp/percona-release.rpm https://repo.percona.com/yum/percona-release-latest.noarch.rpm; \ | ||
rpmkeys --checksig /tmp/percona-release.rpm; \ | ||
rpm -i /tmp/percona-release.rpm; \ | ||
rm -rf "$GNUPGHOME" /tmp/percona-release.rpm; \ | ||
rpm --import /etc/pki/rpm-gpg/PERCONA-PACKAGING-KEY; \ | ||
percona-release enable psmdb-70 ${PSMDB_REPO} | ||
|
||
RUN set -ex; \ | ||
curl -Lf -o /tmp/jq.rpm http://vault.centos.org/centos/8/AppStream/x86_64/os/Packages/jq-1.5-12.el8.x86_64.rpm; \ | ||
curl -Lf -o /tmp/oniguruma.rpm http://vault.centos.org/centos/8/AppStream/x86_64/os/Packages/oniguruma-6.8.2-2.el8.x86_64.rpm; \ | ||
rpmkeys --checksig /tmp/jq.rpm /tmp/oniguruma.rpm; \ | ||
\ | ||
rpm -i /tmp/jq.rpm /tmp/oniguruma.rpm; \ | ||
rm -rf /tmp/jq.rpm /tmp/oniguruma.rpm | ||
|
||
RUN set -ex; \ | ||
microdnf install -y \ | ||
percona-server-mongodb-mongos-${FULL_PERCONA_VERSION} \ | ||
percona-server-mongodb-tools-${FULL_PERCONA_VERSION} \ | ||
percona-mongodb-mongosh \ | ||
shadow-utils \ | ||
curl \ | ||
tar \ | ||
procps-ng \ | ||
cyrus-sasl-gssapi \ | ||
policycoreutils; \ | ||
\ | ||
curl -Lf -o /tmp/Percona-Server-MongoDB-server.rpm http://repo.percona.com/psmdb-70/yum/${PSMDB_REPO}/8/RPMS/x86_64/percona-server-mongodb-server-${FULL_PERCONA_VERSION}.x86_64.rpm; \ | ||
rpmkeys --checksig /tmp/Percona-Server-MongoDB-server.rpm; \ | ||
rpm -iv /tmp/Percona-Server-MongoDB-server.rpm --nodeps; \ | ||
rm -rf /tmp/Percona-Server-MongoDB-server.rpm; \ | ||
microdnf clean all; \ | ||
rm -rf /var/cache/dnf /var/cache/yum /data/db && mkdir -p /data/db; \ | ||
chown -R 1001:0 /data/db | ||
|
||
# the numeric UID is needed for OpenShift | ||
RUN useradd -u 1001 -r -g 0 -m -s /sbin/nologin \ | ||
-c "Default Application User" mongodb; \ | ||
chmod g+rwx /var/log/mongo; \ | ||
chown :0 /var/log/mongo | ||
|
||
COPY LICENSE /licenses/LICENSE.Dockerfile | ||
RUN cp /usr/share/doc/percona-server-mongodb-server/LICENSE-Community.txt /licenses/LICENSE.Percona-Server-for-MongoDB | ||
|
||
ENV GOSU_VERSION=1.11 | ||
RUN set -eux; \ | ||
curl -Lf -o /usr/bin/gosu https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64; \ | ||
curl -Lf -o /usr/bin/gosu.asc https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64.asc; \ | ||
\ | ||
export GNUPGHOME="$(mktemp -d)"; \ | ||
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ | ||
gpg --batch --verify /usr/bin/gosu.asc /usr/bin/gosu; \ | ||
rm -rf "$GNUPGHOME" /usr/bin/gosu.asc; \ | ||
\ | ||
chmod +x /usr/bin/gosu; \ | ||
curl -f -o /licenses/LICENSE.gosu https://raw.githubusercontent.com/tianon/gosu/${GOSU_VERSION}/LICENSE | ||
|
||
RUN set -ex; \ | ||
curl -fSL https://github.com/percona/mongodb-orchestration-tools/releases/download/${K8S_TOOLS_VERSION}/k8s-mongodb-initiator -o /usr/local/bin/k8s-mongodb-initiator; \ | ||
curl -fSL https://github.com/percona/mongodb-orchestration-tools/releases/download/${K8S_TOOLS_VERSION}/mongodb-healthcheck -o /usr/local/bin/mongodb-healthcheck; \ | ||
curl -fSL https://github.com/percona/mongodb-orchestration-tools/releases/download/${K8S_TOOLS_VERSION}/SHA256SUMS -o /tmp/SHA256SUMS; \ | ||
echo "$(grep 'k8s-mongodb-initiator' /tmp/SHA256SUMS | awk '{print $1}')" /usr/local/bin/k8s-mongodb-initiator | sha256sum -c -; \ | ||
echo "$(grep 'mongodb-healthcheck' /tmp/SHA256SUMS | awk '{print $1}')" /usr/local/bin/mongodb-healthcheck | sha256sum -c -; \ | ||
rm -f /tmp/SHA256SUMS; \ | ||
\ | ||
chmod 0755 /usr/local/bin/k8s-mongodb-initiator /usr/local/bin/mongodb-healthcheck | ||
|
||
VOLUME ["/data/db"] | ||
|
||
RUN set -ex; \ | ||
curl -fSL https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.1.0/js-yaml.min.js -o /js-yaml.js; \ | ||
echo "45dc3dd03dc07a06705a2c2989b8c7f709013f04bd5386e3279d4e447f07ebd7 /js-yaml.js" | sha256sum -c - | ||
|
||
COPY ps-entry.sh /entrypoint.sh | ||
|
||
ARG DEBUG | ||
RUN if [[ -n $DEBUG ]] ; then \ | ||
set -ex; \ | ||
sed -i 's/exec "$@"/exec "$@" -vvv || sleep infinity/' /entrypoint.sh; \ | ||
curl -Lf -o /tmp/telnet.rpm http://vault.centos.org/centos/8/AppStream/x86_64/os/Packages/telnet-0.17-76.el8.x86_64.rpm; \ | ||
rpm -i /tmp/telnet.rpm; \ | ||
rm -f /tmp/telnet.rpm; \ | ||
|
||
microdnf install -y \ | ||
net-tools \ | ||
sudo \ | ||
gdb \ | ||
nc \ | ||
percona-server-mongodb-server-debuginfo-${FULL_PERCONA_VERSION} \ | ||
percona-server-mongodb-tools-debuginfo-${FULL_PERCONA_VERSION} \ | ||
percona-server-mongodb-mongos-debuginfo-${FULL_PERCONA_VERSION} \ | ||
percona-server-mongodb-tools-${FULL_PERCONA_VERSION} \ | ||
percona-server-mongodb-debugsource-${FULL_PERCONA_VERSION}; \ | ||
microdnf clean all; \ | ||
rm -rf /var/cache/dnf /var/cache/yum; \ | ||
fi | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
EXPOSE 27017 | ||
|
||
USER 1001 | ||
|
||
CMD ["mongod"] |
Oops, something went wrong.