-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmongodb.Dockerfile
More file actions
29 lines (24 loc) · 1022 Bytes
/
mongodb.Dockerfile
File metadata and controls
29 lines (24 loc) · 1022 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Build stage for applying security updates
FROM mongo:8.0.17-noble AS build
# Update and install security patches
# Clean up apt cache to reduce image size
RUN apt update && \
apt-mark hold mongodb-org* && \
DEBIAN_FRONTEND=noninteractive apt upgrade -y -o Dpkg::Options::="--force-confold" && \
DEBIAN_FRONTEND=noninteractive apt full-upgrade -y -o Dpkg::Options::="--force-confold" && \
apt autoremove -y && \
apt clean && \
rm -rf /var/lib/apt/lists/*
# Production stage
FROM build AS production
# Add Dockerfile Labels
LABEL title="MongoDB with Security Updates"
LABEL description="MongoDB based on official mongo:8.0.17-noble image with all security patches applied"
LABEL version="8.0.17"
LABEL maintainer="Vadim Starichkov <starichkovva@gmail.com>"
LABEL license="MIT"
LABEL source="https://github.com/starichkov/nodejs-simple-notes-app.git"
LABEL created="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
# Expose MongoDB port
EXPOSE 27017
# Use the default entrypoint and cmd from the parent image