Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
feat: S6 overlay (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
lholota committed Mar 13, 2020
1 parent e32ecc7 commit ea3dc56
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
* text=auto
* text=auto eol=lf
*.sh eol=lf
16 changes: 15 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,24 @@ WORKDIR /go/src/github.com/homecentr/docker-swarm-local-network-connector
RUN go get ./... && \
go build

FROM homecentr/base:1.1.0 as base

LABEL maintainer="Lukas Holota <[email protected]>"

FROM alpine:3.11.3

# Install packages required by base
RUN apk add --no-cache \
shadow=4.7-r1

# Copy S6 overlay
COPY --from=base / /
COPY --from=build /go/src/github.com/homecentr/docker-swarm-local-network-connector/docker-swarm-local-network-connector /swarm-local-network-connector

# Copy S6 overlay configuration
COPY ./fs/ /

# Make the binary executable
RUN chmod a+x /swarm-local-network-connector

ENTRYPOINT [ "/swarm-local-network-connector" ]
ENTRYPOINT [ "/init" ]
3 changes: 3 additions & 0 deletions fs/etc/services.d/connector/finish
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/execlineb -S1

s6-svscanctl -t /var/run/s6/services
5 changes: 5 additions & 0 deletions fs/etc/services.d/connector/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/with-contenv sh

s6-setuidgid "$PUID:$PGID"

exec /swarm-local-network-connector

0 comments on commit ea3dc56

Please sign in to comment.