ci: build locally with kaniko + push to DockerHub
All checks were successful
continuous-integration/drone/push Build is passing
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:
parent
e2029dcea4
commit
7ef4d5e919
77
.drone.yml
77
.drone.yml
@ -1,53 +1,64 @@
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: dockerhub-build-trigger
|
||||
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:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- push
|
||||
- cron
|
||||
ref:
|
||||
exclude:
|
||||
- ref/tags/**
|
||||
- refs/heads/master
|
||||
- "refs/heads/feature-**"
|
||||
- "refs/pull/**"
|
||||
- "refs/tags/**"
|
||||
event:
|
||||
exclude: [cron]
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: kaniko-build
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
depends_on:
|
||||
- dockerhub-build-trigger
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
- 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-cdev
|
||||
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
|
||||
@ -82,7 +93,7 @@ trigger:
|
||||
- failure
|
||||
|
||||
depends_on:
|
||||
- kaniko-build
|
||||
- testing
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
@ -119,4 +130,4 @@ trigger:
|
||||
- failure
|
||||
|
||||
depends_on:
|
||||
- kaniko-build
|
||||
- testing
|
||||
|
3
.hadolint.yaml
Normal file
3
.hadolint.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
ignored:
|
||||
# ad "DL3007 archlinux is always updating
|
||||
- DL3007
|
16
Dockerfile
16
Dockerfile
@ -1,3 +1,4 @@
|
||||
# syntax=docker/dockerfile:1.2
|
||||
FROM immawanderer/archlinux:latest
|
||||
|
||||
ARG BUILD_DATE
|
||||
@ -8,11 +9,12 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
|
||||
org.label-schema.vcs-ref=$VCS_REF \
|
||||
org.label-schema.license=GPL-3.0
|
||||
|
||||
RUN pacman -Syu --noconfirm --ignore glibc --needed gcc cmake make git valgrind
|
||||
RUN pacman --noconfirm -R $(pacman -Qdtq) || true
|
||||
RUN pacman -Scc && rm -rfv /var/cache/pacman/* /var/lib/pacman/sync/* \
|
||||
&& rm -rv /usr/share/info/* ;rm -rv /usr/share/man/* ; \
|
||||
rm -rv /usr/share/doc/* ;rm -r /usr/share/zoneinfo/* ;rm -rv /usr/share/i18n/*; \
|
||||
RUN pacman --version
|
||||
|
||||
RUN pacman -Syu --noconfirm --needed gcc cmake make git valgrind
|
||||
RUN pacman --noconfirm -Rn "$(pacman -Qdtq)" || true
|
||||
RUN pacman -Scc && rm -rf /var/cache/pacman/* /var/lib/pacman/sync/* \
|
||||
&& rm -rf /usr/share/info/* ;rm -rf /usr/share/man/* ; \
|
||||
rm -rf /usr/share/doc/* ;rm -rf /usr/share/zoneinfo/* ;rm -rf /usr/share/i18n/*; \
|
||||
find /. -name "*~" -type f -delete; \
|
||||
find /usr/share/terminfo/. ! -name "*xterm*" ! -name "*screen*" ! -name "*screen*" -type f -delete; \
|
||||
rm -rfv /tmp/* || true
|
||||
find /usr/share/terminfo/. ! -name "*xterm*" ! -name "*screen*" ! -name "*screen*" -type f -delete;
|
||||
|
@ -7,6 +7,13 @@
|
||||
|
||||
This repository provides the Dockerfile to create a Docker image used for light C development (some goodies included).
|
||||
|
||||
## :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 approximately every hour to ensure it always has the latest packages.
|
||||
|
||||
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-cdev)
|
||||
|
Loading…
Reference in New Issue
Block a user