adds openssl
This commit is contained in:
parent
7b1b8c1f2a
commit
80b91056be
@ -1,32 +1,40 @@
|
||||
def label = "jenkins-${UUID.randomUUID().toString()}"
|
||||
#!groovy
|
||||
|
||||
def repository = "registry.c.test-chamber-13.lan"
|
||||
def kanikoImage = "${repository}/library/kaniko:latest"
|
||||
def repositoryCreds = "harbor-repository-creds"
|
||||
|
||||
podTemplate(
|
||||
label: label,
|
||||
name: "pipeline-worker",
|
||||
yaml: """---
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
spec:
|
||||
containers:
|
||||
- name: kaniko
|
||||
image: ${kanikoImage}
|
||||
tty: true
|
||||
command:
|
||||
- /busybox/cat
|
||||
- name: alpine
|
||||
image: ${repository}/library/alpine:latest
|
||||
tty: true
|
||||
command:
|
||||
- /bin/sh
|
||||
""",
|
||||
) {
|
||||
node (label) {
|
||||
def workspace = pwd()
|
||||
def dockerFile = """
|
||||
FROM ${repository}/library/alpine:latest
|
||||
|
||||
RUN apk add --no-cache openssl && \\
|
||||
addgroup -g 1000 -S vlmcsd && \\
|
||||
adduser -u 1000 -G vlmcsd -S -D -h /home/vlmcsd vlmcsd
|
||||
|
||||
COPY vlmcsd/bin/vlmcsd vlmcsd/etc/vlmcsd.kmd /home/vlmcsd
|
||||
|
||||
EXPOSE 1688/tcp
|
||||
|
||||
WORKDIR /home/vlmcsd
|
||||
|
||||
HEALTHCHECK --interval=1m --timeout=3s --start-period=10s --retries=3 \
|
||||
CMD /bin/sh -c 'printf \\'\\n\\' | openssl s_client --connect 127.0.0.1:1688 2> /dev/null | grep \\'CONNECTED\\''
|
||||
|
||||
ENTRYPOINT ["/bin/sh", "-c", "./vlmcsd -L 0.0.0.0:1688 -m 5 -t 5 -e -N1 -B1 -r1 -C 1033 -R 1w -A 1h -H 36446 -v -D -j ./vlmcsd.kmd"]
|
||||
"""
|
||||
|
||||
def label = "kubernetes-${UUID.randomUUID().toString()}"
|
||||
def templateName = "pipeline-worker"
|
||||
podTemplate (
|
||||
label: label,
|
||||
name: templateName,
|
||||
yaml: functions.podYaml(
|
||||
repo: repository,
|
||||
templateName: templateName,
|
||||
kaniko: true,
|
||||
alpine: true
|
||||
)
|
||||
){
|
||||
node (label) {
|
||||
stage ("Pull VLMCSD Source") {
|
||||
dir("vlmcsd") {
|
||||
checkout ([
|
||||
@ -66,44 +74,11 @@ spec:
|
||||
}
|
||||
}
|
||||
|
||||
container ("kaniko") {
|
||||
stage ("Prepare Kaniko") {
|
||||
withCredentials([usernameColonPassword(
|
||||
credentialsId: repositoryCreds,
|
||||
variable: "dCreds",
|
||||
)]) {
|
||||
def dockerJSON = """{
|
||||
"auths": {
|
||||
"${repository}": {
|
||||
"auth": "${dcreds.bytes.encodeBase64().toString()}"
|
||||
}
|
||||
}
|
||||
}"""
|
||||
sh """
|
||||
set +x
|
||||
echo '${dockerJSON}' > /kaniko/.docker/config.json
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
stage("Kaniko Build & Push") {
|
||||
def dockerfile = """
|
||||
FROM ${repository}/library/alpine:latest
|
||||
|
||||
RUN addgroup -g 1000 -S vlmcsd && \\
|
||||
adduser -u 1000 -G vlmcsd -S -D -h /home/vlmcsd vlmcsd
|
||||
|
||||
COPY vlmcsd/bin/vlmcsd vlmcsd/etc/vlmcsd.kmd /home/vlmcsd
|
||||
|
||||
EXPOSE 1688/tcp
|
||||
|
||||
WORKDIR /home/vlmcsd
|
||||
|
||||
ENTRYPOINT ["/bin/sh", "-c", "./vlmcsd -L 0.0.0.0:1688 -m 5 -t 5 -e -N1 -B1 -r1 -C 1033 -R 1w -A 1h -H 36446 -v -D -j ./vlmcsd.kmd"]
|
||||
"""
|
||||
writeFile (file: workspace + "/Dockerfile", text: dockerfile)
|
||||
sh "/kaniko/executor --context \"${workspace}\" -f \"${workspace}/Dockerfile\" --destination \"${repository}/library/vlmcsd:latest\""
|
||||
}
|
||||
}
|
||||
functions.buildContainer(
|
||||
repository: repository,
|
||||
imageDest: "${repository}/library/vlmcsd:latest",
|
||||
dockerFile: dockerFile,
|
||||
repoCreds: repositoryCreds,
|
||||
)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user