Switch to node builer
This commit is contained in:
parent
24cd67c982
commit
7f6304d37e
19
Dockerfile
19
Dockerfile
@ -1,23 +1,17 @@
|
|||||||
# Base on latest (edge) alpine image
|
# Base on latest (edge) alpine image
|
||||||
FROM registry.ervine.dev/library/x86_64/alpine/alpine-3.11
|
FROM registry.ervine.dev/library/x86_64/alpine/alpine:3.12
|
||||||
|
|
||||||
MAINTAINER “Jonathan Ervine” <docker@ervine.org>
|
MAINTAINER “Jonathan Ervine” <docker@ervine.org>
|
||||||
|
|
||||||
# Install updates
|
# Install updates
|
||||||
ENV LANG='en_US.UTF-8' \
|
ENV LANG='en_US.UTF-8' \
|
||||||
LANGUAGE='en_US.UTF-8' \
|
LANGUAGE='en_US.UTF-8' \
|
||||||
TERM='xterm' \
|
TERM='xterm'
|
||||||
VERSION='0.3.2' \
|
|
||||||
MED_USER='mediaservice' \
|
|
||||||
MED_GROUP='mediaservice' \
|
|
||||||
MED_UID='1003' \
|
|
||||||
MED_GID='1003'
|
|
||||||
|
|
||||||
RUN echo http://dl-4.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \
|
RUN echo http://dl-4.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \
|
||||||
apk update && \
|
apk update && \
|
||||||
apk -U upgrade && \
|
apk -U upgrade --ignore alpein-baselayout && \
|
||||||
apk -U add \
|
apk -U add python3
|
||||||
python
|
|
||||||
|
|
||||||
RUN wget https://github.com/pymedusa/Medusa/archive/v$VERSION.tar.gz -O medusa.tar.gz && \
|
RUN wget https://github.com/pymedusa/Medusa/archive/v$VERSION.tar.gz -O medusa.tar.gz && \
|
||||||
tar zxvf medusa.tar.gz && \
|
tar zxvf medusa.tar.gz && \
|
||||||
@ -26,12 +20,7 @@ RUN wget https://github.com/pymedusa/Medusa/archive/v$VERSION.tar.gz -O medusa.t
|
|||||||
apk del make gcc g++ && \
|
apk del make gcc g++ && \
|
||||||
rm -rf /tmp/src && \
|
rm -rf /tmp/src && \
|
||||||
rm -rf /var/cache/apk/* && \
|
rm -rf /var/cache/apk/* && \
|
||||||
addgroup -g $MED_GID $MED_GROUP && \
|
|
||||||
adduser -D -u $MED_UID -G $MED_GROUP -H $MED_USER && \
|
|
||||||
chown -R $MED_USER:$MED_GROUP /medusa
|
|
||||||
|
|
||||||
EXPOSE 8081
|
EXPOSE 8081
|
||||||
|
|
||||||
USER $MED_USER
|
|
||||||
|
|
||||||
CMD [ "/usr/bin/python", "/medusa/SickBeard.py", "--nolaunch", "--datadir=/config" ]
|
CMD [ "/usr/bin/python", "/medusa/SickBeard.py", "--nolaunch", "--datadir=/config" ]
|
||||||
|
|||||||
46
Jenkinsfile
vendored
46
Jenkinsfile
vendored
@ -1,17 +1,35 @@
|
|||||||
node("docker-node") {
|
podTemplate(yaml: """
|
||||||
docker.withRegistry('https://harbor.ervine.org', credentials: 'jenkins-to-harbor') {
|
kind: Pod
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: kaniko
|
||||||
|
image: gcr.io/kaniko-project/executor:debug-539ddefcae3fd6b411a95982a830d987f4214251
|
||||||
|
imagePullPolicy: Always
|
||||||
|
command:
|
||||||
|
- /busybox/cat
|
||||||
|
tty: true
|
||||||
|
volumeMounts:
|
||||||
|
- name: jenkins-docker-cfg
|
||||||
|
mountPath: /kaniko/.docker
|
||||||
|
volumes:
|
||||||
|
- name: jenkins-docker-cfg
|
||||||
|
projected:
|
||||||
|
sources:
|
||||||
|
- secret:
|
||||||
|
name: regcred
|
||||||
|
items:
|
||||||
|
- key: .dockerconfigjson
|
||||||
|
path: config.json
|
||||||
|
"""
|
||||||
|
) {
|
||||||
|
|
||||||
git branch: "3.11.3", url: "ssh://git@git.ervine.org:2222/jonny/x86_64-alpine-muximux", credentialsId: 'jenkins-to-git'
|
node(POD_LABEL) {
|
||||||
|
stage('Build with Kaniko') {
|
||||||
sh "git rev-parse HEAD > .git/commit-id"
|
git url: 'ssh://git@git.ervine.org/jonny/x86_64-alpine-muximux.git', credentialsId: 'jenkins-to-git'
|
||||||
def commit_id = readFile('.git/commit-id').trim()
|
container('kaniko') {
|
||||||
println commit_id
|
sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --cache=true --destination=harbor.ervine.dev/library/x86_64/alpine/muximux:3.12'
|
||||||
|
|
||||||
stage "build"
|
|
||||||
def app = docker.build "x86_64/alpine/muximux"
|
|
||||||
|
|
||||||
stage "publish"
|
|
||||||
app.push("${env.BUILD_NUMBER}")
|
|
||||||
app.push("latest")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user