82441f35 by Adam Heath

Add java, mongodb, and redis recipes.

1 parent 2b17eb2d
1 FROM debian:stretch-slim
2
3 ARG JAVA_EXTRA_PACKAGES
4
5 COPY files/ /tmp/files/
6 RUN /tmp/files/configure
7
8 ENTRYPOINT ["/sbin/entrypoint"]
1 #!/bin/sh
2
3 set -e
4 apt-get update
5 mkdir -p /usr/share/man/man1
6 apt-get install -y ssmtp sudo openjdk-8-jdk $JAVA_EXTRA_PACKAGES
7
8 cp /tmp/files/entrypoint /sbin/entrypoint
9
10 addgroup hostgroup
11 adduser --gecos 'Host User' --ingroup hostgroup --disabled-password hostuser
12
13 rm -rf /tmp/files
1 #!/bin/bash
2
3 set -ex
4
5 TARGET_USER=hostuser
6 TARGET_GROUP=hostgroup
7
8 target_home="$(getent passwd "$TARGET_USER" | cut -f 6 -d :)"
9
10 if [[ $GID && $GID -ne 0 ]]; then
11 groupmod -g $GID "$TARGET_GROUP"
12 fi
13 if [[ $UID && $UID -ne 0 ]]; then
14 usermod -u $UID "$TARGET_USER"
15 fi
16
17 find "$target_home" \
18 '(' -not -user "$TARGET_USER" -a -not -group "$TARGET_GROUP" -exec chown "$TARGET_USER:$TARGET_GROUP" '{}' + ')' -o \
19 '(' -not -user "$TARGET_USER" -exec chown "$TARGET_USER" '{}' + ')' -o \
20 '(' -not -group "$TARGET_GROUP" -exec chgrp "$TARGET_GROUP" '{}' + ')' -o \
21 -true
22
23 if [[ $http_proxy =~ ^([^:]+)://([^/:]*)(:([0-9]+?))?(/.*)?$ ]]; then
24 http_proxy_protocol="${BASH_REMATCH[1]}"
25 http_proxy_domain="${BASH_REMATCH[2]}"
26 http_proxy_port="${BASH_REMATCH[4]}"
27 fi
28
29 if [[ $http_proxy ]]; then
30 mkdir -p "$target_home/.m2"
31 cat > "$target_home/.m2/settings.xml" << _EOF_
32 <settings>
33 <proxies>
34 <proxy>
35 <id>app-build-proxy</id>
36 <active>true</active>
37 <protocol>${http_proxy_protocol}</protocol>
38 <host>${http_proxy_domain}</host>
39 <port>${http_proxy_port}</port>
40 </proxy>
41 </proxies>
42 </settings>
43 _EOF_
44 fi
45
46 exec "$@"
1 FROM debian:stretch-slim
2
3 COPY files/ /tmp/files/
4 RUN /tmp/files/configure
5
6 ENTRYPOINT ["/sbin/entrypoint"]
7 VOLUME "/data"
8 CMD ["sudo", "-u", "mongodb", "/usr/bin/mongod", "--nounixsocket", "--dbpath", "/var/lib/mongodb"]
1 #!/bin/sh
2
3 set -e
4 apt-get update
5 apt-get install -y sudo ssmtp mongodb-server
6
7 cp /tmp/files/entrypoint /sbin/entrypoint
8
9 rm -rf /tmp/files
1 #!/bin/bash
2
3 set -ex
4
5 TARGET_USER=mongodb
6 TARGET_GROUP=mongodb
7
8 target_home="$(getent passwd "$TARGET_USER" | cut -f 6 -d :)"
9
10 if [[ $GID && $GID -ne 0 ]]; then
11 groupmod -g $GID "$TARGET_GROUP"
12 fi
13 if [[ $UID && $UID -ne 0 ]]; then
14 usermod -u $UID "$TARGET_USER"
15 fi
16
17 find "$target_home" \
18 '(' -not -user "$TARGET_USER" -a -not -group "$TARGET_GROUP" -exec chown "$TARGET_USER:$TARGET_GROUP" '{}' + ')' -o \
19 '(' -not -user "$TARGET_USER" -exec chown "$TARGET_USER" '{}' + ')' -o \
20 '(' -not -group "$TARGET_GROUP" -exec chgrp "$TARGET_GROUP" '{}' + ')' -o \
21 -true
22
23 exec "$@"
1 FROM debian:stretch-slim
2
3 COPY files/ /tmp/files/
4 RUN /tmp/files/configure
5
6 ENTRYPOINT ["/sbin/entrypoint"]
7 VOLUME "/data"
8 CMD ["sudo", "-u", "redis", "redis-server", "/etc/redis/redis.conf"],
1 #!/bin/sh
2
3 set -e
4 apt-get update
5 apt-get install -y sudo ssmtp redis-server
6
7 cp /tmp/files/entrypoint /sbin/entrypoint
8
9 rm -rf /tmp/files
1 #!/bin/bash
2
3 set -ex
4
5 TARGET_GROUP=redis
6 TARGET_USER=redis
7
8 target_home="$(getent passwd "$TARGET_USER" | cut -f 6 -d :)"
9
10 if [[ $GID && $GID -ne 0 ]]; then
11 groupmod -g $GID "$TARGET_GROUP"
12 fi
13 if [[ $UID && $UID -ne 0 ]]; then
14 usermod -u $UID "$TARGET_USER"
15 fi
16
17 find "$target_home" \
18 '(' -not -user "$TARGET_USER" -a -not -group "$TARGET_GROUP" -exec chown "$TARGET_USER:$TARGET_GROUP" '{}' + ')' -o \
19 '(' -not -user "$TARGET_USER" -exec chown "$TARGET_USER" '{}' + ')' -o \
20 '(' -not -group "$TARGET_GROUP" -exec chgrp "$TARGET_GROUP" '{}' + ')' -o \
21 -true
22
23 exec "$@"