mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-21 06:33:30 +00:00
Merge pull request #134 from resin-io/alpine
Add alpine supervisor build info
This commit is contained in:
commit
ebf2c04a08
39
Dockerfile.alpine.amd64
Normal file
39
Dockerfile.alpine.amd64
Normal file
@ -0,0 +1,39 @@
|
||||
FROM resin/amd64-alpine-node:0.10.44-slim
|
||||
|
||||
# Supervisor apt dependencies
|
||||
RUN apk add --update \
|
||||
btrfs-progs \
|
||||
ca-certificates \
|
||||
rsync \
|
||||
supervisor \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
# Copy supervisord configuration files
|
||||
COPY config/supervisor/ /etc/supervisor/
|
||||
|
||||
# Install dependencies
|
||||
WORKDIR /app
|
||||
COPY package.json postinstall.sh /app/
|
||||
RUN set -x \
|
||||
&& buildDeps='g++ sqlite-dev sqlite-libs make' \
|
||||
&& apk add --update $buildDeps \
|
||||
&& JOBS=MAX npm install --unsafe-perm --production --no-optional --build-from-source \
|
||||
&& npm dedupe \
|
||||
&& npm cache clean \
|
||||
&& rm -rf /tmp/* \
|
||||
&& apk del $buildDeps \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
# Copy source
|
||||
COPY . /app/
|
||||
|
||||
RUN /app/node_modules/.bin/coffee -c /app/src \
|
||||
&& ln -sf /app/entry.alpine.sh /start # Needed for legacy
|
||||
|
||||
RUN chmod +x /app/bin/gosuper
|
||||
|
||||
ENV SUPERVISOR_IMAGE resin/amd64-alpine-supervisor
|
||||
ENV CONFIG_MOUNT_POINT /boot/config.json
|
||||
ENV LED_FILE /dev/null
|
||||
|
||||
ENTRYPOINT ["/app/entry.alpine.sh"]
|
39
Dockerfile.alpine.armv7hf
Normal file
39
Dockerfile.alpine.armv7hf
Normal file
@ -0,0 +1,39 @@
|
||||
FROM resin/armhf-alpine-node:0.10.44-slim
|
||||
|
||||
# Supervisor apt dependencies
|
||||
RUN apk add --update \
|
||||
btrfs-progs \
|
||||
ca-certificates \
|
||||
rsync \
|
||||
supervisor \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
# Copy supervisord configuration files
|
||||
COPY config/supervisor/ /etc/supervisor/
|
||||
|
||||
# Install dependencies
|
||||
WORKDIR /app
|
||||
COPY package.json postinstall.sh /app/
|
||||
RUN set -x \
|
||||
&& buildDeps='g++ sqlite-dev sqlite-libs make' \
|
||||
&& apk add --update $buildDeps \
|
||||
&& JOBS=MAX npm install --unsafe-perm --production --no-optional --build-from-source \
|
||||
&& npm dedupe \
|
||||
&& npm cache clean \
|
||||
&& rm -rf /tmp/* \
|
||||
&& apk del $buildDeps \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
# Copy source
|
||||
COPY . /app/
|
||||
|
||||
RUN /app/node_modules/.bin/coffee -c /app/src \
|
||||
&& ln -sf /app/entry.alpine.sh /start # Needed for legacy
|
||||
|
||||
RUN chmod +x /app/bin/gosuper
|
||||
|
||||
ENV SUPERVISOR_IMAGE resin/armhf-alpine-supervisor
|
||||
ENV CONFIG_MOUNT_POINT /boot/config.json
|
||||
ENV LED_FILE /dev/null
|
||||
|
||||
ENTRYPOINT ["/app/entry.alpine.sh"]
|
39
Dockerfile.alpine.i386
Normal file
39
Dockerfile.alpine.i386
Normal file
@ -0,0 +1,39 @@
|
||||
FROM resin/i386-alpine-node:0.10.44-slim
|
||||
|
||||
# Supervisor apt dependencies
|
||||
RUN apk add --update \
|
||||
btrfs-progs \
|
||||
ca-certificates \
|
||||
rsync \
|
||||
supervisor \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
# Copy supervisord configuration files
|
||||
COPY config/supervisor/ /etc/supervisor/
|
||||
|
||||
# Install dependencies
|
||||
WORKDIR /app
|
||||
COPY package.json postinstall.sh /app/
|
||||
RUN set -x \
|
||||
&& buildDeps='g++ sqlite-dev sqlite-libs make' \
|
||||
&& apk add --update $buildDeps \
|
||||
&& JOBS=MAX npm install --unsafe-perm --production --no-optional --build-from-source \
|
||||
&& npm dedupe \
|
||||
&& npm cache clean \
|
||||
&& rm -rf /tmp/* \
|
||||
&& apk del $buildDeps \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
# Copy source
|
||||
COPY . /app/
|
||||
|
||||
RUN /app/node_modules/.bin/coffee -c /app/src \
|
||||
&& ln -sf /app/entry.alpine.sh /start # Needed for legacy
|
||||
|
||||
RUN chmod +x /app/bin/gosuper
|
||||
|
||||
ENV SUPERVISOR_IMAGE resin/i386-alpine-supervisor
|
||||
ENV CONFIG_MOUNT_POINT /boot/config.json
|
||||
ENV LED_FILE /dev/null
|
||||
|
||||
ENTRYPOINT ["/app/entry.alpine.sh"]
|
39
Dockerfile.alpine.rpi
Normal file
39
Dockerfile.alpine.rpi
Normal file
@ -0,0 +1,39 @@
|
||||
FROM resin/armhf-alpine-node:0.10.44-slim
|
||||
|
||||
# Supervisor apt dependencies
|
||||
RUN apk add --update \
|
||||
btrfs-progs \
|
||||
ca-certificates \
|
||||
rsync \
|
||||
supervisor \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
# Copy supervisord configuration files
|
||||
COPY config/supervisor/ /etc/supervisor/
|
||||
|
||||
# Install dependencies
|
||||
WORKDIR /app
|
||||
COPY package.json postinstall.sh /app/
|
||||
RUN set -x \
|
||||
&& buildDeps='g++ sqlite-dev sqlite-libs make' \
|
||||
&& apk add --update $buildDeps \
|
||||
&& JOBS=MAX npm install --unsafe-perm --production --no-optional --build-from-source \
|
||||
&& npm dedupe \
|
||||
&& npm cache clean \
|
||||
&& rm -rf /tmp/* \
|
||||
&& apk del $buildDeps \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
# Copy source
|
||||
COPY . /app/
|
||||
|
||||
RUN /app/node_modules/.bin/coffee -c /app/src \
|
||||
&& ln -sf /app/entry.alpine.sh /start # Needed for legacy
|
||||
|
||||
RUN chmod +x /app/bin/gosuper
|
||||
|
||||
ENV SUPERVISOR_IMAGE resin/armhf-alpine-supervisor
|
||||
ENV CONFIG_MOUNT_POINT /boot/config.json
|
||||
ENV LED_FILE /dev/null
|
||||
|
||||
ENTRYPOINT ["/app/entry.alpine.sh"]
|
18
Makefile
18
Makefile
@ -1,6 +1,7 @@
|
||||
DISABLE_CACHE = 'false'
|
||||
|
||||
ARCH = rpi# rpi/amd64/i386/armv7hf/armel
|
||||
BASE_DISTRO =
|
||||
|
||||
DEPLOY_REGISTRY =
|
||||
|
||||
@ -9,13 +10,22 @@ JOB_NAME = 1
|
||||
|
||||
all: supervisor
|
||||
|
||||
IMAGE = "resin/$(ARCH)-supervisor:$(SUPERVISOR_VERSION)"
|
||||
SUPERVISOR_IMAGE=$(DEPLOY_REGISTRY)$(IMAGE)
|
||||
|
||||
PUBNUB_SUBSCRIBE_KEY = sub-c-bananas
|
||||
PUBNUB_PUBLISH_KEY = pub-c-bananas
|
||||
MIXPANEL_TOKEN = bananasbananas
|
||||
|
||||
ifdef BASE_DISTRO
|
||||
$(info BASE_DISTRO SPECIFIED. START BUILDING ALPINE SUPERVISOR)
|
||||
IMAGE = "resin/$(ARCH)-supervisor:$(SUPERVISOR_VERSION)-alpine"
|
||||
DOCKERFILE = alpine.$(ARCH)
|
||||
else
|
||||
$(info BASE_DISTRO NOT SPECIFIED. START BUILDING DEBIAN SUPERVISOR)
|
||||
IMAGE = "resin/$(ARCH)-supervisor:$(SUPERVISOR_VERSION)"
|
||||
DOCKERFILE = $(ARCH)
|
||||
endif
|
||||
|
||||
SUPERVISOR_IMAGE=$(DEPLOY_REGISTRY)$(IMAGE)
|
||||
|
||||
ifeq ($(ARCH),rpi)
|
||||
GOARCH = arm
|
||||
GOARM = 6
|
||||
@ -60,7 +70,7 @@ stop-supervisor:
|
||||
-docker rm -f --volumes resin_supervisor_1 > /dev/null || true
|
||||
|
||||
supervisor: gosuper
|
||||
cp Dockerfile.$(ARCH) Dockerfile
|
||||
cp Dockerfile.$(DOCKERFILE) Dockerfile
|
||||
echo "ENV VERSION "`jq -r .version package.json` >> Dockerfile
|
||||
echo "ENV DEFAULT_PUBNUB_PUBLISH_KEY $(PUBNUB_PUBLISH_KEY)" >> Dockerfile
|
||||
echo "ENV DEFAULT_PUBNUB_SUBSCRIBE_KEY $(PUBNUB_SUBSCRIBE_KEY)" >> Dockerfile
|
||||
|
@ -11,36 +11,29 @@ docker pull resin/${ARCH}-supervisor:${ESCAPED_BRANCH_NAME} || docker pull resin
|
||||
# Test the gosuper
|
||||
make SUPERVISOR_VERSION=${VERSION} JOB_NAME=${JOB_NAME} test-gosuper
|
||||
|
||||
# Build the images
|
||||
make SUPERVISOR_VERSION=${ESCAPED_BRANCH_NAME} \
|
||||
ARCH=${ARCH} \
|
||||
JOB_NAME=${JOB_NAME} \
|
||||
DEPLOY_REGISTRY= \
|
||||
PUBNUB_SUBSCRIBE_KEY=${PUBNUB_SUBSCRIBE_KEY} \
|
||||
PUBNUB_PUBLISH_KEY=${PUBNUB_PUBLISH_KEY} \
|
||||
MIXPANEL_TOKEN=${MIXPANEL_TOKEN} \
|
||||
deploy
|
||||
make SUPERVISOR_VERSION=${VERSION} \
|
||||
ARCH=${ARCH} \
|
||||
JOB_NAME=${JOB_NAME} \
|
||||
DEPLOY_REGISTRY= \
|
||||
PUBNUB_SUBSCRIBE_KEY=${PUBNUB_SUBSCRIBE_KEY} \
|
||||
PUBNUB_PUBLISH_KEY=${PUBNUB_PUBLISH_KEY} \
|
||||
MIXPANEL_TOKEN=${MIXPANEL_TOKEN} \
|
||||
deploy
|
||||
make SUPERVISOR_VERSION=${ESCAPED_BRANCH_NAME} \
|
||||
ARCH=${ARCH} \
|
||||
JOB_NAME=${JOB_NAME} \
|
||||
DEPLOY_REGISTRY=registry.resinstaging.io/ \
|
||||
PUBNUB_SUBSCRIBE_KEY=${PUBNUB_SUBSCRIBE_KEY} \
|
||||
PUBNUB_PUBLISH_KEY=${PUBNUB_PUBLISH_KEY} \
|
||||
MIXPANEL_TOKEN=${MIXPANEL_TOKEN} \
|
||||
deploy
|
||||
make SUPERVISOR_VERSION=${VERSION} \
|
||||
ARCH=${ARCH} \
|
||||
JOB_NAME=${JOB_NAME} \
|
||||
DEPLOY_REGISTRY=registry.resinstaging.io/ \
|
||||
PUBNUB_SUBSCRIBE_KEY=${PUBNUB_SUBSCRIBE_KEY} \
|
||||
PUBNUB_PUBLISH_KEY=${PUBNUB_PUBLISH_KEY} \
|
||||
MIXPANEL_TOKEN=${MIXPANEL_TOKEN} \
|
||||
deploy
|
||||
MAKE_ARGS="ARCH=${ARCH} \
|
||||
JOB_NAME=${JOB_NAME} \
|
||||
BASE_DISTRO=${BASE_DISTRO} \
|
||||
PUBNUB_SUBSCRIBE_KEY=${PUBNUB_SUBSCRIBE_KEY} \
|
||||
PUBNUB_PUBLISH_KEY=${PUBNUB_PUBLISH_KEY} \
|
||||
MIXPANEL_TOKEN=${MIXPANEL_TOKEN}"
|
||||
|
||||
make ${MAKE_ARGS} \
|
||||
SUPERVISOR_VERSION=${ESCAPED_BRANCH_NAME} \
|
||||
DEPLOY_REGISTRY= \
|
||||
deploy
|
||||
|
||||
make ${MAKE_ARGS} \
|
||||
SUPERVISOR_VERSION=${VERSION} \
|
||||
DEPLOY_REGISTRY= \
|
||||
deploy
|
||||
|
||||
make ${MAKE_ARGS} \
|
||||
SUPERVISOR_VERSION=${ESCAPED_BRANCH_NAME} \
|
||||
DEPLOY_REGISTRY=registry.resinstaging.io/ \
|
||||
deploy
|
||||
|
||||
make ${MAKE_ARGS} \
|
||||
SUPERVISOR_VERSION=${VERSION} \
|
||||
DEPLOY_REGISTRY=registry.resinstaging.io/ \
|
||||
deploy
|
||||
|
31
entry.alpine.sh
Executable file
31
entry.alpine.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
[ -d /dev/net ] ||
|
||||
mkdir -p /dev/net
|
||||
[ -c /dev/net/tun ] ||
|
||||
mknod /dev/net/tun c 10 200
|
||||
|
||||
mkdir -p /var/log/supervisor && touch /var/log/supervisor/supervisord.log
|
||||
mkdir -p /var/run/resin
|
||||
mount -t tmpfs -o size=1m tmpfs /var/run/resin
|
||||
|
||||
if [ -z "$GOSUPER_SOCKET" ]; then
|
||||
export GOSUPER_SOCKET=/var/run/resin/gosuper.sock
|
||||
fi
|
||||
if [ -z "$DOCKER_SOCKET" ]; then
|
||||
export DOCKER_SOCKET=/run/docker.sock
|
||||
fi
|
||||
if [ -z "$HOST_PROC" ]; then
|
||||
export HOST_PROC=/mnt/root/proc
|
||||
fi
|
||||
|
||||
export DBUS_SYSTEM_BUS_ADDRESS="unix:path=/mnt/root/run/dbus/system_bus_socket"
|
||||
|
||||
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
||||
|
||||
supervisorctl -c /etc/supervisor/supervisord.conf start resin-supervisor
|
||||
supervisorctl -c /etc/supervisor/supervisord.conf start go-supervisor
|
||||
|
||||
tail -f /var/log/supervisor/supervisord.log
|
@ -25,7 +25,7 @@
|
||||
"resin-register-device": "^2.0.0",
|
||||
"request-progress": "^0.3.1",
|
||||
"rwlock": "^5.0.0",
|
||||
"sqlite3": "~3.0.4",
|
||||
"sqlite3": "3.0.9",
|
||||
"typed-error": "~0.1.0"
|
||||
},
|
||||
"engines": {
|
||||
|
Loading…
Reference in New Issue
Block a user