Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Roxedus committed Apr 17, 2020
0 parents commit 9816b45
Show file tree
Hide file tree
Showing 7 changed files with 962 additions and 0 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Build Container
on:
push:
paths:
- "Dockerfile"
- "root/**"
- ".github/workflows/build.yml"

jobs:
build-and-push-container:
runs-on: ubuntu-latest

env:
BUILDKIT_HOST: tcp://0.0.0.0:1234
DOCKER_CLI_EXPERIMENTAL: enabled
PLATFORM_1: amd64
PLATFORM_2: arm
PLATFORM_3: arm64

steps:
- uses: actions/checkout@v2
- name: Create VARS
env:
_repo: ${{github.repository}}
_ref: ${{github.ref}}
id: vars
run: |
brnch=$(echo ${_ref} | cut -d/ -f3)
if [ "$brnch" == "master" ]; then
branch=""
else
branch="${brnch}-"
fi
echo "::set-output name=branch::${branch}"
echo "::set-output name=username::$(echo ${_repo} | cut -d/ -f1 | tr '[:upper:]' '[:lower:]')"
echo "::set-output name=repo::$(echo ${_repo//docker-/} | tr '[:upper:]' '[:lower:]')"
- name: Getting buildkit
run: |
sudo docker run --privileged linuxkit/binfmt:v0.7
sudo docker run -d --privileged -p 1234:1234 --name buildkit moby/buildkit:latest --addr ${BUILDKIT_HOST} \
--oci-worker-platform linux/${PLATFORM_1} \
--oci-worker-platform linux/${PLATFORM_2} \
--oci-worker-platform linux/${PLATFORM_3}
sudo docker cp buildkit:/usr/bin/buildctl /usr/bin/
- name: Build amd64
run: |
buildctl build --frontend dockerfile.v0 \
--opt platform=linux/${PLATFORM_1} \
--output type=docker,name=${{ steps.vars.outputs.repo }}:${{ steps.vars.outputs.branch }}${PLATFORM_1} \
--local dockerfile=. \
--local context=. | docker load
- name: Build armhf
run: |
buildctl build --frontend dockerfile.v0 \
--opt platform=linux/${PLATFORM_2} \
--output type=docker,name=${{ steps.vars.outputs.repo }}:${{ steps.vars.outputs.branch }}${PLATFORM_2} \
--local dockerfile=. \
--local context=. | docker load
- name: Build arm64
run: |
buildctl build --frontend dockerfile.v0 \
--opt platform=linux/${PLATFORM_3} \
--output type=docker,name=${{ steps.vars.outputs.repo }}:${{ steps.vars.outputs.branch }}${PLATFORM_3} \
--local dockerfile=. \
--local context=. | docker load
- name: Login to registry
if: github.event.issue.pull_request != 'false'
env:
DOCKER_USERNAME: roxedus
DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
run: echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin

- name: Publish images
if: github.event.issue.pull_request != 'false'
run: |
docker push ${{ steps.vars.outputs.repo }}:${{ steps.vars.outputs.branch }}${PLATFORM_1}
docker push ${{ steps.vars.outputs.repo }}:${{ steps.vars.outputs.branch }}${PLATFORM_2}
docker push ${{ steps.vars.outputs.repo }}:${{ steps.vars.outputs.branch }}${PLATFORM_3}
- name: Create latest manifest
if: github.event.issue.pull_request != 'false' && github.ref == 'refs/heads/master'
run: |
docker manifest create ${{ steps.vars.outputs.repo }}:latest \
${{ steps.vars.outputs.repo }}:${{ steps.vars.outputs.branch }}${PLATFORM_1} \
${{ steps.vars.outputs.repo }}:${{ steps.vars.outputs.branch }}${PLATFORM_2} \
${{ steps.vars.outputs.repo }}:${{ steps.vars.outputs.branch }}${PLATFORM_3}
docker manifest push ${{ steps.vars.outputs.repo }}:latest
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-roxedus/base:2020-04-11_20.57}

LABEL maintainer="christronyxyocum,Roxedus"

LABEL org.label-schema.name="organizr/Organizr" \
org.label-schema.description="Docker image for Organizr" \
org.label-schema.url="https://organizr.app/" \
org.label-schema.vcs-url="https://github.com/organizr/docker-organizr" \
org.label-schema.schema-version="1.0"

ENV fpm="false" branch="v2-master"

# add local files
COPY root/ /


# ports and volumes
EXPOSE 80 443
VOLUME /config
Loading

0 comments on commit 9816b45

Please sign in to comment.