Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

creating main #2

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
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
21 changes: 14 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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" ]
Empty file modified entrypoint.sh
100644 → 100755
Empty file.