initial commit
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2020-10-27 22:37:38 +01:00
commit 6a14b9d2c7
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
5 changed files with 111 additions and 0 deletions

29
.drone.yml Normal file

@ -0,0 +1,29 @@
---
kind: pipeline
name: dockerhub-build-trigger
platform:
os: linux
arch: amd64
clone:
disable: true
trigger:
branch:
- master
event:
- push
- cron
steps:
- name: call webhook
pull: always
image: bash:latest
environment:
ENDPOINT:
from_secret: dockerhub_endpoint
commands:
- apk add --no-cache curl
- curl -sO https://git.dotya.ml/${DRONE_REPO}/raw/branch/master/curl.it
- bash ./curl.it $ENDPOINT

51
Dockerfile Normal file

@ -0,0 +1,51 @@
FROM node:12.19.0-alpine3.12
ENV GLIB_PACKAGE_BASE_URL https://github.com/sgerrand/alpine-pkg-glibc/releases/download
ENV GLIB_VERSION 2.32-r0
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
ENV GRADLE_HOME /usr/local/gradle
ENV GRADLE_VERSION 6.7
ENV ANDROID_HOME /usr/local/android-sdk-linux
ENV ANDRDOID_TOOLS_VERSION r25.2.5
ENV ANDROID_API_LEVELS android-29
ENV ANDROID_BUILD_TOOLS_VERSION 29.0.2
ENV IONIC_VERSION 5.4.16
ENV PATH ${GRADLE_HOME}/bin:${JAVA_HOME}/bin:${ANDROID_HOME}/tools:$ANDROID_HOME/platform-tools:$PATH
RUN apk update && \
apk add curl openjdk8-jre openjdk8
RUN npm install -g cordova ionic@${IONIC_VERSION}
RUN mkdir -p ${GRADLE_HOME} && \
curl -L https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip > /tmp/gradle.zip && \
unzip /tmp/gradle.zip -d ${GRADLE_HOME} && \
mv ${GRADLE_HOME}/gradle-${GRADLE_VERSION}/* ${GRADLE_HOME} && \
rm -r ${GRADLE_HOME}/gradle-${GRADLE_VERSION}/
RUN mkdir -p ${ANDROID_HOME} && \
curl -L https://dl.google.com/android/repository/tools_${ANDRDOID_TOOLS_VERSION}-linux.zip > /tmp/tools.zip && \
unzip /tmp/tools.zip -d ${ANDROID_HOME}
RUN curl -L https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub > /etc/apk/keys/sgerrand.rsa.pub && \
curl -L ${GLIB_PACKAGE_BASE_URL}/${GLIB_VERSION}/glibc-${GLIB_VERSION}.apk > /tmp/glibc.apk && \
curl -L ${GLIB_PACKAGE_BASE_URL}/${GLIB_VERSION}/glibc-bin-${GLIB_VERSION}.apk > /tmp/glibc-bin.apk && \
apk add /tmp/glibc-bin.apk /tmp/glibc.apk
RUN echo y | android update sdk --no-ui -a --filter platform-tools,${ANDROID_API_LEVELS},build-tools-${ANDROID_BUILD_TOOLS_VERSION}
RUN mkdir $ANDROID_HOME/licenses && \
echo 8933bad161af4178b1185d1a37fbf41ea5269c55 > $ANDROID_HOME/licenses/android-sdk-license && \
echo d56f5187479451eabf01fb78af6dfcb131a6481e >> $ANDROID_HOME/licenses/android-sdk-license && \
echo 24333f8a63b6825ea9c5514f83c2829b004d1fee >> $ANDROID_HOME/licenses/android-sdk-license && \
echo 84831b9409646a918e30573bab4c9c91346d8abd > $ANDROID_HOME/licenses/android-sdk-preview-license
RUN rm -rf /tmp/* /var/cache/apk/*
RUN npm i cordova-res
RUN cordova telemetry off
RUN npm install

14
README.md Normal file

@ -0,0 +1,14 @@
# docker-alpine-ionic
[![Build Status](https://drone.dotya.ml/api/badges/wanderer/docker-alpine-ionic/status.svg)](https://drone.dotya.ml/wanderer/docker-alpine-ionic)
[![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/immawanderer/alpine-ionic)](https://hub.docker.com/r/immawanderer/alpine-ionic/builds)
[![](https://images.microbadger.com/badges/version/immawanderer/archlinux.svg)](https://microbadger.com/images/immawanderer/archlinux)
[![](https://images.microbadger.com/badges/commit/immawanderer/archlinux.svg)](https://microbadger.com/images/immawanderer/archlinux)
The image is rebuilt approximately every hour to ensure it always has the latest packages.
push mirror lives in [this GitHub repo](https://github.com/wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf/docker-alpine-ionic)
development happens on [this Gitea instance](https://git.dotya.ml/wanderer/docker-alpine-ionic)
## Purpose
* Alpine-based image to enable easily building apps using `ionic` and `cordova` in CI

7
curl.it Executable file

@ -0,0 +1,7 @@
#!/bin/bash
if [ $# -gt 1 ]; then
curl -s -H 'Content-Type: application/json' --data '{"docker_tag":"nightly"}' -X POST $2
else
curl -s -H 'Content-Type: application/json' --data '{"docker_tag":"latest"}' -X POST $1
fi

10
hooks/build Normal file

@ -0,0 +1,10 @@
#!/bin/bash
# as per https://github.com/rossf7/label-schema-automated-build
# $IMAGE_NAME var is injected into the build so the tag is correct.
echo "Build hook running"
docker build --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
-t $IMAGE_NAME .