diff --git a/Dockerfile b/Dockerfile index e22b06e..1b3cf9c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM docker.io/bitnami/minideb:buster AS mongodb ARG DEBIAN_FRONTEND=noninteractive ARG resolvingdeps=https://github.com/tran4774/Resolving-Shared-Library/releases/download/v1.0.3/resolving.sh -ARG mongo_version=5.0 +ARG mongo_version=7.0 ARG mongo_pgp=https://www.mongodb.org/static/pgp/server-${mongo_version}.asc ADD ${resolvingdeps} /home/resolvingdeps.sh ADD ${mongo_pgp} /home/key.asc @@ -10,25 +10,32 @@ RUN \ && apt-key add /home/key.asc \ && echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/${mongo_version} main" | tee /etc/apt/sources.list.d/mongodb-org-${mongo_version}.list \ && apt-get update \ - && apt-get install mongodb-org-server mongodb-org-shell -y \ + && apt-get install mongodb-org mongodb-org-server mongodb-org-shell -y \ && apt-get purge -y gnupg RUN \ chmod +x /home/resolvingdeps.sh \ && /home/resolvingdeps.sh -f /usr/bin/mongod -d /home/deps \ - && /home/resolvingdeps.sh -f /usr/bin/mongo -d /home/deps \ + && /home/resolvingdeps.sh -f /usr/bin/mongosh -d /home/deps \ && apt-get autoremove -y \ && apt-get autoclean --dry-run \ && apt-get clean --dry-run + +RUN ls /usr/bin | grep mongo + +COPY entrypoint.sh /home +RUN chmod +x /home/entrypoint.sh + FROM docker.io/library/busybox:stable AS shell -FROM gcr.io/distroless/static +FROM gcr.io/distroless/static:latest COPY --from=shell /bin/ /bin/ COPY --from=mongodb /etc/mongod.conf /etc/ -COPY --from=mongodb /usr/bin/mongod /usr/bin/mongo /usr/bin/ +COPY --from=mongodb /usr/bin/mongod /usr/bin/mongosh /usr/bin/ COPY --from=mongodb /home/key.asc /data/db/ COPY --from=mongodb /home/deps/ / -COPY entrypoint.sh script.js /home/ +COPY --from=mongodb /home/entrypoint.sh /home/ +COPY script.js /home/ WORKDIR /home -RUN chmod +x entrypoint.sh + EXPOSE 27017 ENTRYPOINT [ "/home/entrypoint.sh" ] diff --git a/entrypoint.sh b/entrypoint.sh old mode 100644 new mode 100755