From 8ff1c8676ef17e638cf34f54b8781cb0a2cd8675 Mon Sep 17 00:00:00 2001 From: The_Spider Date: Fri, 28 Jan 2022 09:17:57 -0600 Subject: [PATCH] adds glibc --- build-alpine-glibc.jenkins | 80 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 build-alpine-glibc.jenkins diff --git a/build-alpine-glibc.jenkins b/build-alpine-glibc.jenkins new file mode 100644 index 0000000..1c1c53c --- /dev/null +++ b/build-alpine-glibc.jenkins @@ -0,0 +1,80 @@ +#!groovy + +def repository = "registry.c.test-chamber-13.lan" +def repositoryCreds = "harbor-repository-creds" + +def AlpineGlibcBaseURL="https://github.com/sgerrand/alpine-pkg-glibc/releases/download" +def AlpineGlibcPackageVersion = "2.34-r0" +def AlpineGlibcBasePackageFilename = "glibc-${AlpineGlibcPackageVersion}.apk" +def AlpineGlibcBinPackageFilename = "glibc-bin-${AlpineGlibcPackageVersion}.apk" +def AlpineGlibcI18nPackageFilename = "glibc-i18n-${AlpineGlibcPackageVersion}.apk" + +def GlibcLanguage = "C.UTF-8" +def TimeZone = "America/Chicago" + +def dockerFile = """ +FROM registry.c.test-chamber-13.lan/library/alpine:latest + +LABEL org.opencontainers.image.authors="The_Spider " + +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} +""" + +def label = "kubernetes-${UUID.randomUUID().toString()}" +def templateName = "pipeline-worker" +podTemplate( + label: label, + name: templateName, + yaml: functions.podYaml( + repo: repository, + templateName: templateName, + kaniko: true + ) +) { + node (label) { + def workspace = pwd() + + functions.buildContainer( + repository: repository, + imageDest: "${repository}/library/alpine-glibc:latest", + dockerFile: dockerFile, + repoCreds: repositoryCreds, + [ + "LANG=${GlibcLanguage}", + "TZ=${TimeZone}" + ] + ) + } +}