Tiniest Docker Image based on alpine with tini inside and su-exec
to run services inside safely within a non-root approach.
tini?See tini Why? section.
See also this comment for a detailed explanation.
su-exec?su-exec does more or less exactly the same thing as gosu but it is only 10kb instead of 1.8MB.
See gosu Why? section.
Run with user id 500:
$ docker run -it -e USERID=500 tini/mini
Override the username:
$ docker run -it -e USERID=999 -e USERNAME=postgres tini/mini
Dockerifle
FROM tini/mini
RUN apk add --no-cache postgresql
ENV PGDATA /var/lib/postgresql/data
ENV USERNAME postgres
COPY docker-entrypoint.sh /
CMD ["postgres"]
docker-entrypoint.sh
#!/bin/sh
su-exec postgres initdb $PGDATA
exec /tini-entrypoint.sh "$@"
USERID - Creates a user with this integer id.USERNAME - If USERID provided a user with this name will be created. Default tiniminiContent type
Image
Digest
Size
2 MB
Last updated
over 8 years ago
docker pull tini/mini