Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gizmoguy committed May 23, 2018
0 parents commit eacb63a
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Image name: faucet/base

FROM alpine:3.7
RUN apk add --no-cache bash su-exec
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
6 changes: 6 additions & 0 deletions Dockerfile.pi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Image name: faucet/base-pi

FROM multiarch/alpine:armhf-v3.7
RUN apk add --no-cache bash su-exec
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
15 changes: 15 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Faucet Base Docker Image
========================

This is the base image used for many of the other Docker images for the
`faucet project <https://faucet.nz>`_.

Pull from Docker Hub
--------------------

Built images are available on Docker Hub so that you don't need to build your own.

Images are available for the following architectures:

* `amd64 <https://hub.docker.com/r/faucet/base/>`_
* `armhf (for raspberry pi) <https://hub.docker.com/r/faucet/base-pi/>`_
15 changes: 15 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Add local user
# Either use the LOCAL_USER_ID if passed in at runtime or
# fallback to 0 to maintain backwards compatibility

USER_ID=${LOCAL_USER_ID:-0}
GROUP_ID=${LOCAL_GROUP_ID:-0}

echo "Starting with UID=$USER_ID GID=$GROUP_ID"
export HOME=/home/faucet
addgroup -g $GROUP_ID faucet >/dev/null 2>&1 || true
adduser -u $USER_ID -G faucet -g "" -h $HOME -D faucet >/dev/null 2>&1 || true

exec /sbin/su-exec faucet "$@"
4 changes: 4 additions & 0 deletions hooks/pre_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

# We need qemu-user-static for arm/pi builds
docker run --rm --privileged multiarch/qemu-user-static:register --reset

0 comments on commit eacb63a

Please sign in to comment.