Add java, mongodb, and redis recipes.
Showing
9 changed files
with
147 additions
and
0 deletions
java/Dockerfile
0 → 100644
java/files/configure
0 → 100755
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 |
java/files/entrypoint
0 → 100755
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 "$@" |
mongodb/Dockerfile
0 → 100644
mongodb/files/configure
0 → 100755
mongodb/files/entrypoint
0 → 100755
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 "$@" |
redis/Dockerfile
0 → 100644
redis/files/configure
0 → 100755
redis/files/entrypoint
0 → 100755
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 "$@" |
-
Please register or sign in to post a comment