Supports multiple glib-c versions
This commit is contained in:
parent
4b3d9e29ae
commit
de12c26206
@ -4,13 +4,9 @@ def repository = "registry.c.test-chamber-13.lan"
|
|||||||
def repositoryCreds = "harbor-repository-creds"
|
def repositoryCreds = "harbor-repository-creds"
|
||||||
|
|
||||||
def workspace
|
def workspace
|
||||||
def dockerFile
|
|
||||||
|
|
||||||
def AlpineGlibcBaseURL="https://nexus.c.test-chamber-13.lan/repository/github-releases/sgerrand/alpine-pkg-glibc/releases/download"
|
def AlpineGlibcBaseURL="https://nexus.c.test-chamber-13.lan/repository/github-releases/sgerrand/alpine-pkg-glibc/releases/download"
|
||||||
def AlpineGlibcPackageVersion
|
def staticVersion = "2.34-r0"
|
||||||
def AlpineGlibcBasePackageFilename
|
|
||||||
def AlpineGlibcBinPackageFilename
|
|
||||||
def AlpineGlibcI18nPackageFilename
|
|
||||||
|
|
||||||
def GlibcLanguage = "C.UTF-8"
|
def GlibcLanguage = "C.UTF-8"
|
||||||
def TimeZone = "America/Chicago"
|
def TimeZone = "America/Chicago"
|
||||||
@ -43,19 +39,28 @@ pipeline {
|
|||||||
apk add --no-cache jq
|
apk add --no-cache jq
|
||||||
fi
|
fi
|
||||||
"""
|
"""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
AlpineGlibcPackageVersion = sh (
|
stage ('Build & Push (latest)') {
|
||||||
|
steps {
|
||||||
|
container ('kaniko') {
|
||||||
|
script {
|
||||||
|
def AlpineGlibcPackageVersion = sh (
|
||||||
script: "curl --silent --location --fail \"https://api.github.com/repos/sgerrand/alpine-pkg-glibc/releases\" | jq -r .[0].name",
|
script: "curl --silent --location --fail \"https://api.github.com/repos/sgerrand/alpine-pkg-glibc/releases\" | jq -r .[0].name",
|
||||||
returnStdout: true
|
returnStdout: true
|
||||||
).trim()
|
).trim()
|
||||||
AlpineGlibcBasePackageFilename = "glibc-${AlpineGlibcPackageVersion}.apk"
|
def AlpineGlibcBasePackageFilename = "glibc-${AlpineGlibcPackageVersion}.apk"
|
||||||
AlpineGlibcBinPackageFilename = "glibc-bin-${AlpineGlibcPackageVersion}.apk"
|
def AlpineGlibcBinPackageFilename = "glibc-bin-${AlpineGlibcPackageVersion}.apk"
|
||||||
AlpineGlibcI18nPackageFilename = "glibc-i18n-${AlpineGlibcPackageVersion}.apk"
|
def AlpineGlibcI18nPackageFilename = "glibc-i18n-${AlpineGlibcPackageVersion}.apk"
|
||||||
|
|
||||||
dockerFile = """
|
def dockerFile = """
|
||||||
FROM registry.c.test-chamber-13.lan/library/alpine:latest
|
FROM registry.c.test-chamber-13.lan/library/alpine:latest
|
||||||
|
|
||||||
LABEL maintainer="The_Spider <spider@smoothnet.org>"
|
LABEL org.opencontainers.image.authors="The_Spider <spider@smoothnet.org>"
|
||||||
|
LABEL org.opencontainers.image.title="alpine-glibc"
|
||||||
|
|
||||||
ARG TZ
|
ARG TZ
|
||||||
ARG LANG
|
ARG LANG
|
||||||
@ -91,15 +96,7 @@ RUN apk add --update --no-cache --virtual=.build-dependencies \\
|
|||||||
${AlpineGlibcBinPackageFilename} \\
|
${AlpineGlibcBinPackageFilename} \\
|
||||||
${AlpineGlibcI18nPackageFilename}
|
${AlpineGlibcI18nPackageFilename}
|
||||||
"""
|
"""
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage ('Build & Push') {
|
|
||||||
steps {
|
|
||||||
container ('kaniko') {
|
|
||||||
script {
|
|
||||||
declarativeFunctions.buildContainerMultipleDestinations(
|
declarativeFunctions.buildContainerMultipleDestinations(
|
||||||
dockerFile: dockerFile,
|
dockerFile: dockerFile,
|
||||||
repositoryAccess: [
|
repositoryAccess: [
|
||||||
@ -120,5 +117,76 @@ RUN apk add --update --no-cache --virtual=.build-dependencies \\
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stage ('Build & Push (v' + staticVersion + ')') {
|
||||||
|
steps {
|
||||||
|
container ('kaniko') {
|
||||||
|
script {
|
||||||
|
def AlpineGlibcPackageVersion = staticVersion
|
||||||
|
def AlpineGlibcBasePackageFilename = "glibc-${AlpineGlibcPackageVersion}.apk"
|
||||||
|
def AlpineGlibcBinPackageFilename = "glibc-bin-${AlpineGlibcPackageVersion}.apk"
|
||||||
|
def AlpineGlibcI18nPackageFilename = "glibc-i18n-${AlpineGlibcPackageVersion}.apk"
|
||||||
|
|
||||||
|
def dockerFile = """
|
||||||
|
FROM registry.c.test-chamber-13.lan/library/alpine:latest
|
||||||
|
|
||||||
|
LABEL org.opencontainers.image.authors="The_Spider <spider@smoothnet.org>"
|
||||||
|
LABEL org.opencontainers.image.title="alpine-glibc"
|
||||||
|
|
||||||
|
ARG TZ
|
||||||
|
ARG LANG
|
||||||
|
|
||||||
|
RUN apk add --update --no-cache --virtual=.build-dependencies \\
|
||||||
|
curl \\
|
||||||
|
ca-certificates && \\
|
||||||
|
printf '%s\\n' \\
|
||||||
|
"-----BEGIN PUBLIC KEY-----" \\
|
||||||
|
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApZ2u1KJKUu/fW4A25y9m" \\
|
||||||
|
"y70AGEa/J3Wi5ibNVGNn1gT1r0VfgeWd0pUybS4UmcHdiNzxJPgoWQhV2SSW1JYu" \\
|
||||||
|
"tOqKZF5QSN6X937PTUpNBjUvLtTQ1ve1fp39uf/lEXPpFpOPL88LKnDBgbh7wkCp" \\
|
||||||
|
"m2KzLVGChf83MS0ShL6G9EQIAUxLm99VpgRjwqTQ/KfzGtpke1wqws4au0Ab4qPY" \\
|
||||||
|
"KXvMLSPLUp7cfulWvhmZSegr5AdhNw5KNizPqCJT8ZrGvgHypXyiFvvAH5YRtSsc" \\
|
||||||
|
"Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m" \\
|
||||||
|
"1QIDAQAB" \\
|
||||||
|
"-----END PUBLIC KEY-----" > "/etc/apk/keys/sgerrand.rsa.pub" && \\
|
||||||
|
curl -sSLO "${AlpineGlibcBaseURL}/${AlpineGlibcPackageVersion}/${AlpineGlibcBasePackageFilename}" && \\
|
||||||
|
curl -sSLO "${AlpineGlibcBaseURL}/${AlpineGlibcPackageVersion}/${AlpineGlibcBinPackageFilename}" && \\
|
||||||
|
curl -sSLO "${AlpineGlibcBaseURL}/${AlpineGlibcPackageVersion}/${AlpineGlibcI18nPackageFilename}" && \\
|
||||||
|
apk add --no-cache \\
|
||||||
|
"${AlpineGlibcBasePackageFilename}" \\
|
||||||
|
"${AlpineGlibcBinPackageFilename}" \\
|
||||||
|
"${AlpineGlibcI18nPackageFilename}" && \\
|
||||||
|
rm -v "/etc/apk/keys/sgerrand.rsa.pub" && \\
|
||||||
|
(/usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 "\${LANG}" || true) && \\
|
||||||
|
printf '%s\\n' \\
|
||||||
|
"export LANG=\${LANG}" >> /etc/profile.d/locale.sh && \\
|
||||||
|
apk del glibc-i18n && \\
|
||||||
|
apk del .build-dependencies && \\
|
||||||
|
rm -v \\
|
||||||
|
${AlpineGlibcBasePackageFilename} \\
|
||||||
|
${AlpineGlibcBinPackageFilename} \\
|
||||||
|
${AlpineGlibcI18nPackageFilename}
|
||||||
|
"""
|
||||||
|
|
||||||
|
declarativeFunctions.buildContainerMultipleDestinations(
|
||||||
|
dockerFile: dockerFile,
|
||||||
|
repositoryAccess: [
|
||||||
|
[
|
||||||
|
repository: repository,
|
||||||
|
credentials: repositoryCreds
|
||||||
|
],
|
||||||
|
],
|
||||||
|
destination: [
|
||||||
|
"${repository}/library/alpine-glibc:${staticVersion}",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"LANG=${GlibcLanguage}",
|
||||||
|
"TZ=${TimeZone}"
|
||||||
|
]
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,8 @@ pipeline {
|
|||||||
workspace = pwd()
|
workspace = pwd()
|
||||||
dockerFile = """FROM ${repository}/dockerhub/library/alpine:latest
|
dockerFile = """FROM ${repository}/dockerhub/library/alpine:latest
|
||||||
|
|
||||||
LABEL maintainer="The_Spider <spider@smoothnet.org>"
|
LABEL org.opencontainers.image.authors="The_Spider <spider@smoothnet.org>"
|
||||||
|
LABEL org.opencontainers.image.title="alpine"
|
||||||
|
|
||||||
COPY test-chamber-13.lan.root.crt /usr/local/share/ca-certificates/test-chamber-13.lan.root.crt
|
COPY test-chamber-13.lan.root.crt /usr/local/share/ca-certificates/test-chamber-13.lan.root.crt
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user