Skip to content
This repository was archived by the owner on Aug 22, 2019. It is now read-only.

Commit 5e2e007

Browse files
committed
Updating Alpine OS
1 parent aa4daf9 commit 5e2e007

3 files changed

Lines changed: 29 additions & 15 deletions

File tree

Dockerfile

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
1-
FROM alpine:3.6
1+
FROM alpine:3.7
22

3-
RUN apk add --no-cache mongodb
4-
COPY ./scripts/start.sh /
3+
LABEL MAINTAINER="Aurelien PERRIER <a.perrier89@gmail.com>"
4+
LABEL APP="mongodb"
5+
LABEL APP_VERSION="3.4.10-r0"
6+
LABEL APP_REPOSITORY="https://pkgs.alpinelinux.org/package/edge/community/x86_64/mongodb"
7+
8+
ENV TIMEZONE Europe/Paris
9+
10+
# Installing dependencies
11+
RUN apk add --no-cache mongodb su-exec
12+
RUN mkdir -p /data/db
13+
14+
WORKDIR /scripts
15+
16+
COPY ./scripts/start.sh start.sh
517

618
VOLUME [ "/data/db" ]
719

820
EXPOSE 27017 28017
921

10-
ENTRYPOINT [ "./start.sh" ]
11-
CMD [ "mongod" ]
22+
ENTRYPOINT [ "./start.sh" ]

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1-
# alpine-mongodb
1+
# Minio
2+
3+
## Versions
4+
5+
Alpine : `3.7`
6+
MongoDB : `3.4.10-r0`
7+
8+
## Commands
9+
10+
**Pull :** `docker pull perriea/alpine-mongodb:3.7`
11+
**Run :** `docker run -d -p 27017:27017 -p 28017:28017 perriea/alpine-mongodb:3.7`

scripts/start.sh

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
#!/bin/sh
22

3-
# Docker entrypoint (pid 1), run as root
4-
[ "$1" = "mongod" ] || exec "$@" || exit $?
5-
6-
# Make sure that database is owned by user mongodb
7-
[ "$(stat -c %U /data/db)" = mongodb ] || chown -R mongodb /data/db
8-
9-
# Drop root privilege (no way back), exec provided command as user mongodb
10-
cmd=exec; for i; do cmd="$cmd '$i'"; done
11-
exec su -s /bin/sh -c "$cmd" mongodb
3+
chown -R mongodb:mongodb /data
4+
exec su-exec mongodb mongod --dbpath /data/db

0 commit comments

Comments
 (0)