ci: build locally with kaniko + push to DockerHub
All checks were successful
continuous-integration/drone/push Build is passing

* add hadolint Dockerfile linter step
* update Dockerfile to implement hadolint suggestions (cbp)
* switch to immawanderer/drone-kaniko as the kaniko flavour of choice
* add a note to README about the DH builds issue situation
This commit is contained in:
surtur 2021-04-22 22:35:03 +02:00
parent d6c82cca9c
commit 485b1e125e
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
3 changed files with 64 additions and 18 deletions

@ -1,23 +1,64 @@
---
kind: pipeline
name: dockerhub-build-trigger
type: docker
name: testing
platform:
os: linux
arch: amd64
clone:
disable: true
steps:
- name: call webhook
- name: hadolint
pull: always
image: curlimages/curl:latest
environment:
ENDPOINT:
from_secret: dockerhub_endpoint
image: hadolint/hadolint:v1.23.0-8-gb01c5a9-alpine
commands:
- curl -s -X POST $ENDPOINT
- hadolint --version
- hadolint Dockerfile
when:
ref:
- refs/heads/master
- "refs/heads/feature-**"
- "refs/pull/**"
- "refs/tags/**"
event:
exclude: [cron]
- name: kaniko-build
pull: always
image: immawanderer/drone-kaniko:efd19c50
settings:
dockerfile: Dockerfile
context: .
when:
ref:
- "refs/heads/feature-**"
- "refs/pull/**"
- "refs/tags/**"
event:
exclude: [cron]
- name: kaniko-publish
pull: always
image: immawanderer/drone-kaniko:efd19c50
settings:
dockerfile: Dockerfile
context: .
tags:
- latest
- linux-amd64
- ${DRONE_COMMIT_SHA:0:8}
repo: immawanderer/archlinux-hugo
username:
from_secret: docker_username
password:
from_secret: docker_password
when:
ref:
- refs/heads/master
event:
exclude: [pull_request, tag]
trigger:
event: [push, pull_request, cron, tag]
---
kind: pipeline
@ -41,7 +82,7 @@ trigger:
- failure
depends_on:
- dockerhub-build-trigger
- testing
steps:
- name: discord
@ -77,7 +118,7 @@ trigger:
- failure
depends_on:
- dockerhub-build-trigger
- testing
steps:
- name: discord

@ -1,4 +1,4 @@
FROM immawanderer/archlinux:latest
FROM immawanderer/archlinux:linux-amd64
ENV HUGO_VERSION 0.82.1
@ -15,15 +15,15 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
ADD https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz /tmp/hugo.tar.gz
WORKDIR /tmp/
RUN pacman -Syu --noconfirm --needed git && pacman --noconfirm -R $(pacman -Qdtq) || true
RUN pacman -Syu --noconfirm --needed git
RUN pacman --noconfirm -Rn "$(pacman -Qdtq)" || true
RUN bsdtar xfv /tmp/hugo.tar.gz && rm -v /tmp/hugo.tar.gz README.md LICENSE \
&& chmod +x /tmp/hugo \
&& mkdir -pv /usr/local/bin \
&& mv -v /tmp/hugo /usr/local/bin/
RUN pacman -Scc && rm -rf /var/cache/pacman/* /var/lib/pacman/sync/* \
&& rm -r /usr/share/zoneinfo/* ; \
rm -r /usr/share/i18n/* ;rm -r /usr/include/* ; \
&& rm -rf /usr/share/zoneinfo/* ; \
rm -rf /usr/share/i18n/* ;rm -rf /usr/include/* ; \
find /. -name "*~" -type f -delete; \
find /usr/share/terminfo/. ! -name "*xterm*" ! -name "*screen*" ! -name "*screen*" -type f -delete; \
rm -rv /tmp/* || true
find /usr/share/terminfo/. ! -name "*xterm*" ! -name "*screen*" ! -name "*screen*" -type f -delete
WORKDIR /

@ -7,6 +7,11 @@
This repository provides the Dockerfile to create a Docker image used for web developent using [Hugo](https://gohugo.io) website building framework.
## :warning: :construction: DockerHub issue :construction: :warning:
unless you're running Arch (or a Fedora 34+ or some reasonably recent thing) as your host OS, please make sure you read through the following issue write-up (since DH issue affects the base image it affects this one, too) \
⇒ https://git.dotya.ml/wanderer/docker-archlinux/issues/1 \
:warning: :construction: :construction: :construction: :warning:
The image is rebuilt <del>approximately every hour</del> nightly to ensure it always has the latest packages.
push mirror lives in [this GitHub repo](https://github.com/wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf/docker-archlinux-hugo)