Only one build

This commit is contained in:
Jonathan Ervine 2020-12-14 11:40:50 +08:00
parent 75ae08c9ef
commit ec89f53d6c
3 changed files with 17 additions and 26 deletions

View File

@ -1,16 +1,17 @@
FROM harbor.ervine.dev/public/x86_64/alpine:v3.12 FROM harbor.ervine.dev/public/x86_64/alpine:v3.12 AS builder
LABEL Maintainer = "Jonathan Ervine <docker@ervine.org>" LABEL Maintainer = "Jonathan Ervine <docker@ervine.org>"
ENV GETIPLAYER_OUTPUT=/config GETIPLAYER_PROFILE=/config/.get_iplayer PUID=1000 PGID=100 PORT=1935 WORKDIR /root/
EXPOSE 1935
VOLUME /config
RUN apk --update --no-cache add ffmpeg perl-cgi perl-mojolicious perl-lwp-protocol-https perl-xml-libxml jq logrotate su-exec tini RUN apk --update --no-cache add git cmake make gcc gcc-c++
RUN wget -qnd "https://bitbucket.org/shield007/atomicparsley/raw/68337c0c05ec4ba2ad47012303121aaede25e6df/downloads/build_linux_x86_64/AtomicParsley" && \ RUN git clone https://github.com/wez/atomicparsley atomic \
install -m 755 -t /usr/local/bin ./AtomicParsley && \ cd atomic \
rm ./AtomicParsley cmake . && cmake --build . --config Release
FROM harbor.ervine.dev/public/x86_64/alpine:v3.12
COPY --from=builder /root/atomic/AtomicParsley /usr/local/bin/AtomicParsley
RUN wget -qO - "https://api.github.com/repos/get-iplayer/get_iplayer/releases/latest" > /tmp/latest.json && \ RUN wget -qO - "https://api.github.com/repos/get-iplayer/get_iplayer/releases/latest" > /tmp/latest.json && \
echo get_iplayer release `jq -r .name /tmp/latest.json` && \ echo get_iplayer release `jq -r .name /tmp/latest.json` && \
wget -qO - "`jq -r .tarball_url /tmp/latest.json`" | tar -zxf - && \ wget -qO - "`jq -r .tarball_url /tmp/latest.json`" | tar -zxf - && \

View File

@ -1,17 +1,16 @@
FROM harbor.ervine.dev/public/x86_64/alpine:v3.12 AS builder FROM harbor.ervine.dev/public/x86_64/alpine:v3.12
LABEL Maintainer = "Jonathan Ervine <docker@ervine.org>" LABEL Maintainer = "Jonathan Ervine <docker@ervine.org>"
WORKDIR /root/ ENV GETIPLAYER_OUTPUT=/config GETIPLAYER_PROFILE=/config/.get_iplayer PUID=1000 PGID=100 PORT=1935
EXPOSE 1935
VOLUME /config
RUN apk --update --no-cache add git cmake make gcc gcc-c++ RUN apk --update --no-cache add ffmpeg perl-cgi perl-mojolicious perl-lwp-protocol-https perl-xml-libxml jq logrotate su-exec tini
RUN git clone https://github.com/wez/atomicparsley atomic \ RUN wget -qnd "https://bitbucket.org/shield007/atomicparsley/raw/68337c0c05ec4ba2ad47012303121aaede25e6df/downloads/build_linux_x86_64/AtomicParsley" && \
cd atomic \ install -m 755 -t /usr/local/bin ./AtomicParsley && \
cmake . && cmake --build . --config Release rm ./AtomicParsley
FROM harbor.ervine.dev/public/x86_64/alpine:v3.12
COPY --from=builder /root/atomic/AtomicParsley /usr/local/bin/AtomicParsley
RUN wget -qO - "https://api.github.com/repos/get-iplayer/get_iplayer/releases/latest" > /tmp/latest.json && \ RUN wget -qO - "https://api.github.com/repos/get-iplayer/get_iplayer/releases/latest" > /tmp/latest.json && \
echo get_iplayer release `jq -r .name /tmp/latest.json` && \ echo get_iplayer release `jq -r .name /tmp/latest.json` && \
wget -qO - "`jq -r .tarball_url /tmp/latest.json`" | tar -zxf - && \ wget -qO - "`jq -r .tarball_url /tmp/latest.json`" | tar -zxf - && \

9
Jenkinsfile vendored
View File

@ -33,14 +33,5 @@ spec:
stage('Notify gchat') { stage('Notify gchat') {
hangoutsNotify message: "Alpine Linux 3.12.1 with BBC iPlayer has built",token: "A2ET831pVslqXTqAx6ycu573r",threadByJob: false hangoutsNotify message: "Alpine Linux 3.12.1 with BBC iPlayer has built",token: "A2ET831pVslqXTqAx6ycu573r",threadByJob: false
} }
stage('Build multi-stage with Kaniko') {
git url: 'ssh://git@git.ervine.org/jonny/x86_64-alpine-get_iplayer.git', credentialsId: 'jenkins-to-git'
container('kaniko') {
sh '/kaniko/executor -f `pwd`/Dockerfile.multi -c `pwd` --cache=true --destination=harbor.ervine.dev/public/x86_64/alpine/get_iplayer:3.26-1'
}
}
stage('Notify gchatof multi-stage build') {
hangoutsNotify message: "Alpine Linux 3.12.1 with BBC iPlayer 3.26-1 (multi-stage docker build) has built",token: "A2ET831pVslqXTqAx6ycu573r",threadByJob: false
}
} }
} }