Skip to content

Commit

Permalink
adding tavis workflow and multi arch, bumping to stretch
Browse files Browse the repository at this point in the history
  • Loading branch information
thelamer committed Jul 18, 2018
1 parent 7e33dbd commit c8c57cd
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 3 deletions.
54 changes: 54 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
sudo: true

language: bash

services:
- docker

env:
global:
- DEBIAN_FRONTEND="noninteractive"
- DOCKERHUB_LIVE="taisun/gateway"
- GITHUB_REPO="Taisun-Docker/gateway"

jobs:
include:
- stage: BuildMaster
if: (branch = master) AND (NOT (type IN (pull_request)))
before_install:
- /bin/bash pre_install
script:
# Grab the qemu binaries
- wget https://s3-us-west-2.amazonaws.com/taisun-builds/qemu/qemu-aarch64-static
- wget https://s3-us-west-2.amazonaws.com/taisun-builds/qemu/qemu-arm-static
- chmod +x qemu-*
# Build the applicaiton against the 3 architectures
- docker build --no-cache -f Dockerfile.amd64 -t ${DOCKERHUB_LIVE}:amd64-${TRAVIS_COMMIT} .
- docker build --no-cache -f Dockerfile.armhf -t ${DOCKERHUB_LIVE}:arm32v6-${TRAVIS_COMMIT} .
- docker build --no-cache -f Dockerfile.aarch64 -t ${DOCKERHUB_LIVE}:arm64v8-${TRAVIS_COMMIT} .
# Tag these builds to latest
- docker tag ${DOCKERHUB_LIVE}:amd64-${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:amd64-latest
- docker tag ${DOCKERHUB_LIVE}:arm32v6-${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:arm32v6-latest
- docker tag ${DOCKERHUB_LIVE}:arm64v8-${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:arm64v8-latest
# Login to DockerHub
- echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
# Push all of the tags
- docker push ${DOCKERHUB_LIVE}:amd64-${TRAVIS_COMMIT}
- docker push ${DOCKERHUB_LIVE}:arm32v6-${TRAVIS_COMMIT}
- docker push ${DOCKERHUB_LIVE}:arm64v8-${TRAVIS_COMMIT}
- docker push ${DOCKERHUB_LIVE}:amd64-latest
- docker push ${DOCKERHUB_LIVE}:arm32v6-latest
- docker push ${DOCKERHUB_LIVE}:arm64v8-latest
# Generate local manifests for latest and at commit
- docker manifest create ${DOCKERHUB_LIVE}:latest ${DOCKERHUB_LIVE}:amd64-latest ${DOCKERHUB_LIVE}:arm32v6-latest ${DOCKERHUB_LIVE}:arm64v8-latest
- docker manifest annotate ${DOCKERHUB_LIVE}:latest ${DOCKERHUB_LIVE}:arm32v6-latest --os linux --arch arm
- docker manifest annotate ${DOCKERHUB_LIVE}:latest ${DOCKERHUB_LIVE}:arm64v8-latest --os linux --arch arm64 --variant armv8
- docker manifest create ${DOCKERHUB_LIVE}:${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:amd64-${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:arm32v6-${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:arm64v8-${TRAVIS_COMMIT}
- docker manifest annotate ${DOCKERHUB_LIVE}:${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:arm32v6-${TRAVIS_COMMIT} --os linux --arch arm
- docker manifest annotate ${DOCKERHUB_LIVE}:${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:arm64v8-${TRAVIS_COMMIT} --os linux --arch arm64 --variant armv8
# Push the manifests to these meta tags
- docker manifest push ${DOCKERHUB_LIVE}:latest
- docker manifest push ${DOCKERHUB_LIVE}:${TRAVIS_COMMIT}
# Sync readme to DockerHub
- docker pull lsiodev/readme-sync
- docker run --rm=true -e DOCKERHUB_USERNAME=$DOCKERUSER -e DOCKERHUB_PASSWORD=$DOCKERPASS -e GIT_REPOSITORY=${GITHUB_REPO} -e DOCKER_REPOSITORY=${DOCKERHUB_LIVE} -e GIT_BRANCH=master lsiodev/readme-sync bash -c 'node sync'
36 changes: 36 additions & 0 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Dockerfile for the taisun web proxy gateway
# 2017
# From node base image
FROM node@sha256:2db8f0d2db1748792a828e06b6fcd33df108bfec2023b095ebfeaaa4af07c2f1
LABEL maintainer="Ryan Kuba <[email protected]>"
# Add qemu to build on x86_64 systems
COPY qemu-aarch64-static /usr/bin

# Get Packages and easyrsa
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl supervisor apache2-utils && \
curl --insecure https://dl.eff.org/certbot-auto -o /usr/local/bin/certbot-auto && \
chmod +x /usr/local/bin/certbot-auto && \
/usr/local/bin/certbot-auto --noninteractive --os-packages-only && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Add repo bins
ADD ./bin /usr/local/bin
RUN chmod a+x /usr/local/bin/*

# Copy over application and install dependencies
RUN mkdir -p /usr/src/Taisun-gateway
COPY . /usr/src/Taisun-gateway
WORKDIR /usr/src/Taisun-gateway
RUN npm config set unsafe-perm true && \
npm i npm@latest -g && \
npm install


# App runs on 3000
EXPOSE 3000

#Copy over supervisor config file
COPY ./supervisor.conf /etc/supervisor/conf.d/supervisor.conf

CMD ["/usr/bin/supervisord"]
6 changes: 4 additions & 2 deletions Dockerfile → Dockerfile.amd64
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Dockerfile for the taisun web proxy gateway
# 2017
# From node base image
FROM node:8.9
FROM node:9-stretch

LABEL maintainer="Ryan Kuba <[email protected]>"

Expand All @@ -21,7 +21,9 @@ RUN chmod a+x /usr/local/bin/*
RUN mkdir -p /usr/src/Taisun-gateway
COPY . /usr/src/Taisun-gateway
WORKDIR /usr/src/Taisun-gateway
RUN npm install
RUN npm i npm@latest -g && \
npm install


# App runs on 3000
EXPOSE 3000
Expand Down
36 changes: 36 additions & 0 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Dockerfile for the taisun web proxy gateway
# 2017
# From node base image
FROM node@sha256:7d8d1965006c26ba7661f1c1f32d7f16705b2c01b900c3000dc7ed0f8ffa0e17
LABEL maintainer="Ryan Kuba <[email protected]>"
# Add qemu to build on x86_64 systems
COPY qemu-arm-static /usr/bin

# Get Packages and easyrsa
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl supervisor apache2-utils && \
curl --insecure https://dl.eff.org/certbot-auto -o /usr/local/bin/certbot-auto && \
chmod +x /usr/local/bin/certbot-auto && \
/usr/local/bin/certbot-auto --noninteractive --os-packages-only && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Add repo bins
ADD ./bin /usr/local/bin
RUN chmod a+x /usr/local/bin/*

# Copy over application and install dependencies
RUN mkdir -p /usr/src/Taisun-gateway
COPY . /usr/src/Taisun-gateway
WORKDIR /usr/src/Taisun-gateway
RUN npm config set unsafe-perm true && \
npm i npm@latest -g && \
npm install


# App runs on 3000
EXPOSE 3000

#Copy over supervisor config file
COPY ./supervisor.conf /etc/supervisor/conf.d/supervisor.conf

CMD ["/usr/bin/supervisord"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ http://taisun.io

This is a helper container that runs on a public port and allows a user to access their Taisun stacks remotely. More documenation here:

https://gitlab.com/thelamer/taisun/wikis/Usage/Gateway
https://github.com/Taisun-Docker/taisun/wiki/Gateway
12 changes: 12 additions & 0 deletions pre_install
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/with-contenv bash

# Update Docker
sudo apt-get update
sudo apt-get install -y --only-upgrade docker-ce

# Set experiemental features on
mkdir -p ~/.docker/
echo '{"experimental": "enabled"}' > ~/.docker/config.json

# Register the Qemu binaries
docker run --rm --privileged multiarch/qemu-user-static:register

0 comments on commit c8c57cd

Please sign in to comment.