1
1
FROM debian:jessie
2
2
3
- RUN apt-get update && apt-get install -y build-essential scons libssl-dev
3
+ # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
4
+ RUN groupadd -r mongodb && useradd -r -g mongodb mongodb
5
+
6
+ RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ curl \
9
+ libssl-dev \
10
+ scons
4
11
5
12
# "--use-system" deps
6
13
RUN apt-get update && apt-get install -y \
@@ -16,13 +23,16 @@ RUN apt-get update && apt-get install -y \
16
23
libv8-dev
17
24
ENV SCONS_OPTS --use-system-snappy --use-system-tcmalloc --use-system-pcre --use-system-boost --use-system-v8 --ssl
18
25
26
+ RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.0/gosu' \
27
+ && chmod +x /usr/local/bin/gosu
28
+
19
29
ADD . /usr/src/mongo
20
30
WORKDIR /usr/src/mongo
21
31
22
32
# the unstripped binaries and build artifacts are enormous, so we strip and
23
33
# remove them manually to help alleviate that huge layer being an issue
24
34
RUN scons -j"$(nproc)" $SCONS_OPTS core tools \
25
- && find -maxdepth 1 -type f -executable -exec strip '{}' + \
35
+ && find -maxdepth 1 -type f -executable -not -name '*.sh' - exec strip '{}' + \
26
36
&& rm -rf build
27
37
28
38
# the tests compile huge amounts of data, so we skip them for now
@@ -31,9 +41,10 @@ RUN scons -j"$(nproc)" $SCONS_OPTS core tools \
31
41
# since we're stripping and removing build artifacts, we get to install
32
42
# manually too (since scons rightfully thinks we need to rebuild)
33
43
# RUN scons $SCONS_OPTS install
34
- RUN find -maxdepth 1 -type f -executable -exec ln -v '{}' /usr/local/bin/ ';'
44
+ RUN find -maxdepth 1 -type f -executable -not -name '*.sh' - exec ln -v '{}' /usr/local/bin/ ';'
35
45
36
46
VOLUME /data/db
47
+ ENTRYPOINT ["/usr/src/mongo/docker-entrypoint.sh" ]
37
48
38
- EXPOSE 27017 28017
49
+ EXPOSE 27017
39
50
CMD ["mongod" ]
0 commit comments