Skip to content

Commit eacb63a

Browse files
committed
Initial commit
0 parents  commit eacb63a

File tree

5 files changed

+46
-0
lines changed

5 files changed

+46
-0
lines changed

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Image name: faucet/base
2+
3+
FROM alpine:3.7
4+
RUN apk add --no-cache bash su-exec
5+
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
6+
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

Dockerfile.pi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Image name: faucet/base-pi
2+
3+
FROM multiarch/alpine:armhf-v3.7
4+
RUN apk add --no-cache bash su-exec
5+
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
6+
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

README.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Faucet Base Docker Image
2+
========================
3+
4+
This is the base image used for many of the other Docker images for the
5+
`faucet project <https://faucet.nz>`_.
6+
7+
Pull from Docker Hub
8+
--------------------
9+
10+
Built images are available on Docker Hub so that you don't need to build your own.
11+
12+
Images are available for the following architectures:
13+
14+
* `amd64 <https://hub.docker.com/r/faucet/base/>`_
15+
* `armhf (for raspberry pi) <https://hub.docker.com/r/faucet/base-pi/>`_

entrypoint.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# Add local user
4+
# Either use the LOCAL_USER_ID if passed in at runtime or
5+
# fallback to 0 to maintain backwards compatibility
6+
7+
USER_ID=${LOCAL_USER_ID:-0}
8+
GROUP_ID=${LOCAL_GROUP_ID:-0}
9+
10+
echo "Starting with UID=$USER_ID GID=$GROUP_ID"
11+
export HOME=/home/faucet
12+
addgroup -g $GROUP_ID faucet >/dev/null 2>&1 || true
13+
adduser -u $USER_ID -G faucet -g "" -h $HOME -D faucet >/dev/null 2>&1 || true
14+
15+
exec /sbin/su-exec faucet "$@"

hooks/pre_build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
# We need qemu-user-static for arm/pi builds
4+
docker run --rm --privileged multiarch/qemu-user-static:register --reset

0 commit comments

Comments
 (0)