82441f35 by Adam Heath

Add java, mongodb, and redis recipes.

1 parent 2b17eb2d
FROM debian:stretch-slim
ARG JAVA_EXTRA_PACKAGES
COPY files/ /tmp/files/
RUN /tmp/files/configure
ENTRYPOINT ["/sbin/entrypoint"]
#!/bin/sh
set -e
apt-get update
mkdir -p /usr/share/man/man1
apt-get install -y ssmtp sudo openjdk-8-jdk $JAVA_EXTRA_PACKAGES
cp /tmp/files/entrypoint /sbin/entrypoint
addgroup hostgroup
adduser --gecos 'Host User' --ingroup hostgroup --disabled-password hostuser
rm -rf /tmp/files
#!/bin/bash
set -ex
TARGET_USER=hostuser
TARGET_GROUP=hostgroup
target_home="$(getent passwd "$TARGET_USER" | cut -f 6 -d :)"
if [[ $GID && $GID -ne 0 ]]; then
groupmod -g $GID "$TARGET_GROUP"
fi
if [[ $UID && $UID -ne 0 ]]; then
usermod -u $UID "$TARGET_USER"
fi
find "$target_home" \
'(' -not -user "$TARGET_USER" -a -not -group "$TARGET_GROUP" -exec chown "$TARGET_USER:$TARGET_GROUP" '{}' + ')' -o \
'(' -not -user "$TARGET_USER" -exec chown "$TARGET_USER" '{}' + ')' -o \
'(' -not -group "$TARGET_GROUP" -exec chgrp "$TARGET_GROUP" '{}' + ')' -o \
-true
if [[ $http_proxy =~ ^([^:]+)://([^/:]*)(:([0-9]+?))?(/.*)?$ ]]; then
http_proxy_protocol="${BASH_REMATCH[1]}"
http_proxy_domain="${BASH_REMATCH[2]}"
http_proxy_port="${BASH_REMATCH[4]}"
fi
if [[ $http_proxy ]]; then
mkdir -p "$target_home/.m2"
cat > "$target_home/.m2/settings.xml" << _EOF_
<settings>
<proxies>
<proxy>
<id>app-build-proxy</id>
<active>true</active>
<protocol>${http_proxy_protocol}</protocol>
<host>${http_proxy_domain}</host>
<port>${http_proxy_port}</port>
</proxy>
</proxies>
</settings>
_EOF_
fi
exec "$@"
FROM debian:stretch-slim
COPY files/ /tmp/files/
RUN /tmp/files/configure
ENTRYPOINT ["/sbin/entrypoint"]
VOLUME "/data"
CMD ["sudo", "-u", "mongodb", "/usr/bin/mongod", "--nounixsocket", "--dbpath", "/var/lib/mongodb"]
#!/bin/sh
set -e
apt-get update
apt-get install -y sudo ssmtp mongodb-server
cp /tmp/files/entrypoint /sbin/entrypoint
rm -rf /tmp/files
#!/bin/bash
set -ex
TARGET_USER=mongodb
TARGET_GROUP=mongodb
target_home="$(getent passwd "$TARGET_USER" | cut -f 6 -d :)"
if [[ $GID && $GID -ne 0 ]]; then
groupmod -g $GID "$TARGET_GROUP"
fi
if [[ $UID && $UID -ne 0 ]]; then
usermod -u $UID "$TARGET_USER"
fi
find "$target_home" \
'(' -not -user "$TARGET_USER" -a -not -group "$TARGET_GROUP" -exec chown "$TARGET_USER:$TARGET_GROUP" '{}' + ')' -o \
'(' -not -user "$TARGET_USER" -exec chown "$TARGET_USER" '{}' + ')' -o \
'(' -not -group "$TARGET_GROUP" -exec chgrp "$TARGET_GROUP" '{}' + ')' -o \
-true
exec "$@"
FROM debian:stretch-slim
COPY files/ /tmp/files/
RUN /tmp/files/configure
ENTRYPOINT ["/sbin/entrypoint"]
VOLUME "/data"
CMD ["sudo", "-u", "redis", "redis-server", "/etc/redis/redis.conf"],
#!/bin/sh
set -e
apt-get update
apt-get install -y sudo ssmtp redis-server
cp /tmp/files/entrypoint /sbin/entrypoint
rm -rf /tmp/files
#!/bin/bash
set -ex
TARGET_GROUP=redis
TARGET_USER=redis
target_home="$(getent passwd "$TARGET_USER" | cut -f 6 -d :)"
if [[ $GID && $GID -ne 0 ]]; then
groupmod -g $GID "$TARGET_GROUP"
fi
if [[ $UID && $UID -ne 0 ]]; then
usermod -u $UID "$TARGET_USER"
fi
find "$target_home" \
'(' -not -user "$TARGET_USER" -a -not -group "$TARGET_GROUP" -exec chown "$TARGET_USER:$TARGET_GROUP" '{}' + ')' -o \
'(' -not -user "$TARGET_USER" -exec chown "$TARGET_USER" '{}' + ')' -o \
'(' -not -group "$TARGET_GROUP" -exec chgrp "$TARGET_GROUP" '{}' + ')' -o \
-true
exec "$@"