Initial publish
dockers/debian/pipeline/head There was a failure building this commit Details

This commit is contained in:
chris 2020-05-28 13:02:04 +02:00
commit eb5a8dd62e
4 changed files with 126 additions and 0 deletions

45
Dockerfile Normal file
View File

@ -0,0 +1,45 @@
FROM debian:stable as builder
RUN set -xe;\
apt-get update &&\
apt-get install -y debootstrap &&\
debootstrap --include=apt,ca-certificates,curl --foreign --variant=minbase buster /dest &&\
sed -i 's/setup_proc//' /dest/debootstrap/suite-script
FROM scratch as bootstrapped
COPY --from=builder /dest /
RUN set -xe;\
/debootstrap/debootstrap --second-stage &&\
rm -rf /var/cache/apt/archives/* &&\
rm -rf /var/lib/apt/lists/*
FROM bootstrapped as toolbuilder
ARG GOSU_VERSION
ARG DUMB_INIT_VERSION
RUN set -xe;\
apt-get update &&\
apt-get install -y git golang &&\
git clone https://github.com/tianon/gosu.git /build &&\
cd /build &&\
git checkout $GOSU_VERSION &&\
go get || echo 0; go build
RUN set -xe;\
apt-get install -y build-essential &&\
cd / &&\
curl -LO https://github.com/Yelp/dumb-init/archive/v${DUMB_INIT_VERSION}.tar.gz &&\
tar xvzf v${DUMB_INIT_VERSION}.tar.gz &&\
cd dumb-init-${DUMB_INIT_VERSION} &&\
make &&\
cp dumb-init /
FROM bootstrapped
ARG DATE
ARG GOSU_VERSION
ARG DUMB_INIT_VERSION
COPY --from=toolbuilder /build/build /usr/local/sbin/gosu
COPY --from=toolbuilder /dumb-init /usr/local/sbin/dumb-init
COPY apt-install /bin/apt-install
CMD "bash"
LABEL version.debian=buster \
version.gosu=$GOSU_VERSION \
version.dumb-init=$DUMB_INIT_VERSION \
build.date=$DATE

59
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,59 @@
gosu_version = "1.12"
dumb_init_version = "1.2.2"
timeStamp = Calendar.getInstance().getTime().format('YYYY-MM-dd',TimeZone.getTimeZone('UTC'))
pipeline {
agent any
stages {
stage('Build image') {
steps {
withDockerRegistry([ credentialsId: "6ff44976-23cd-4cc2-902c-de8c340e65e5", url: "https://reg.zknt.org" ]) {
script {
def customImage = docker.build("reg.zknt.org/zknt/debian", "--build-arg DATE=$timeStamp --build-arg GOSU_VERSION=$gosu_version --build-arg DUMB_INIT_VERSION=$dumb_init_version --no-cache --pull .")
aquaMicroscanner imageName: 'reg.zknt.org/zknt/debian', notCompliesCmd: '', onDisallowed: 'ignore', outputFormat: 'html'
customImage.push("buster")
customImage.push("stable")
customImage.push("10")
registry_credentials = "3deeee3d-6fce-4430-98dd-9b4db56f43f7"
withDockerRegistry([ credentialsId: registry_credentials ]) {
def official_image = 'zknt/debian:buster'
sh "docker image tag reg.zknt.org/zknt/debian:buster " + official_image
sh "docker push " + official_image
}
}
}
}
}
}
post {
always {
emailext body: 'build finished', subject: '[jenkins] docker ' + project + ': ' + currentBuild.result, to: 'cg@zknt.org', from: 'sysadm@zknt.org', attachLog: true
}
}
options {
buildDiscarder(BuildHistoryManager([
[
conditions: [
BuildResult(matchFailure: true)
],
matchAtMost: 4,
continueAfterMatch: false
],
[
conditions: [
BuildResult(matchSuccess: true)
],
matchAtMost: 2,
continueAfterMatch: false
],
[
conditions: [
BuildResult(matchSuccess: true, matchFailure: true)
],
actions: [DeleteBuild()]
]
]))
}
}

14
README.md Normal file
View File

@ -0,0 +1,14 @@
Debian Buster
=============
Stock Debian 10, installed via debootstrap from official debian image.
This image also includes:
* [gosu](https://github.com/tianon/gosu) to simplify sudo needs in dependant images.
* [dumb-init](https://github.com/Yelp/dumb-init) to simplify signal handling.
* `apt-install` a small wrapper for apt-get install, which cleans up caches after running.
Source repository: https://git.zknt.org/dockers/debian
Public registry: https://hub.docker.com/r/zknt/debian

8
apt-install Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
apt-get update
apt-get install -y --no-install-recommends $@
rc=$?
apt-get clean all
rm -rf /var/lib/apt/lists/*
exit $rc