Skip to content

Commit 249352c

Browse files
committed
multi-arch, build from source
1 parent 908716f commit 249352c

File tree

7 files changed

+158
-21
lines changed

7 files changed

+158
-21
lines changed

Dockerfile

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,52 @@
1-
FROM lsiobase/ubuntu:bionic
1+
FROM lsiobase/alpine:3.11 as buildstage
22

3-
# set version label
4-
ARG BUILD_DATE
5-
ARG VERSION
3+
# build variables
64
ARG PWNDROP_RELEASE
7-
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
8-
LABEL maintainer="aptalca"
95

106
RUN \
11-
echo "**** install pwndrop ****" && \
7+
echo "**** install build packages ****" && \
8+
apk add --no-cache \
9+
curl \
10+
g++ \
11+
gcc \
12+
git \
13+
go \
14+
tar
15+
16+
RUN \
17+
echo "**** fetch source code ****" && \
1218
if [ -z ${PWNDROP_RELEASE+x} ]; then \
1319
PWNDROP_RELEASE=$(curl -sX GET "https://api.github.com/repos/kgretzky/pwndrop/releases/latest" \
1420
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
1521
fi && \
16-
mkdir -p /app/pwndrop && \
22+
mkdir -p \
23+
/tmp/pwndrop && \
1724
curl -o \
18-
/tmp/pwndrop.tar.gz -L \
19-
"https://github.com/kgretzky/pwndrop/releases/download/${PWNDROP_RELEASE}/pwndrop-linux-amd64.tar.gz" && \
20-
tar xzf /tmp/pwndrop.tar.gz -C \
21-
/app/pwndrop --strip-components=1 && \
22-
echo "**** clean up ****" && \
23-
rm -rf \
24-
/tmp/* \
25-
/var/lib/apt/lists/* \
26-
/var/tmp/*
25+
/tmp/pwndrop-src.tar.gz -L \
26+
"https://github.com/kgretzky/pwndrop/archive/${PWNDROP_RELEASE}.tar.gz" && \
27+
tar xf \
28+
/tmp/pwndrop-src.tar.gz -C \
29+
/tmp/pwndrop --strip-components=1 && \
30+
echo "**** compile pwndrop ****" && \
31+
cd /tmp/pwndrop && \
32+
go build -ldflags="-s -w" \
33+
-o /app/pwndrop/pwndrop \
34+
-mod=vendor \
35+
main.go && \
36+
cp -r ./www /app/pwndrop/admin
37+
38+
############## runtime stage ##############
39+
FROM lsiobase/alpine:3.11
40+
41+
# set version label
42+
ARG BUILD_DATE
43+
ARG VERSION
44+
ARG PWNDROP_RELEASE
45+
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
46+
LABEL maintainer="aptalca"
47+
48+
# add pwndrop
49+
COPY --from=buildstage /app/pwndrop/ /app/pwndrop/
2750

2851
# add local files
2952
COPY /root /

Dockerfile.aarch64

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
FROM lsiobase/alpine:arm64v8-3.11 as buildstage
2+
3+
# build variables
4+
ARG PWNDROP_RELEASE
5+
6+
RUN \
7+
echo "**** install build packages ****" && \
8+
apk add --no-cache \
9+
curl \
10+
g++ \
11+
gcc \
12+
git \
13+
go \
14+
tar
15+
16+
RUN \
17+
echo "**** fetch source code ****" && \
18+
if [ -z ${PWNDROP_RELEASE+x} ]; then \
19+
PWNDROP_RELEASE=$(curl -sX GET "https://api.github.com/repos/kgretzky/pwndrop/releases/latest" \
20+
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
21+
fi && \
22+
mkdir -p \
23+
/tmp/pwndrop && \
24+
curl -o \
25+
/tmp/pwndrop-src.tar.gz -L \
26+
"https://github.com/kgretzky/pwndrop/archive/${PWNDROP_RELEASE}.tar.gz" && \
27+
tar xf \
28+
/tmp/pwndrop-src.tar.gz -C \
29+
/tmp/pwndrop --strip-components=1 && \
30+
echo "**** compile pwndrop ****" && \
31+
cd /tmp/pwndrop && \
32+
go build -ldflags="-s -w" \
33+
-o /app/pwndrop/pwndrop \
34+
-mod=vendor \
35+
main.go && \
36+
cp -r ./www /app/pwndrop/admin
37+
38+
############## runtime stage ##############
39+
FROM lsiobase/alpine:arm64v8-3.11
40+
41+
# set version label
42+
ARG BUILD_DATE
43+
ARG VERSION
44+
ARG PWNDROP_RELEASE
45+
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
46+
LABEL maintainer="aptalca"
47+
48+
# add pwndrop
49+
COPY --from=buildstage /app/pwndrop/ /app/pwndrop/
50+
51+
# add local files
52+
COPY /root /
53+
54+
# ports and volumes
55+
EXPOSE 8080 4443

Dockerfile.armhf

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
FROM lsiobase/alpine:arm32v7-3.11 as buildstage
2+
3+
# build variables
4+
ARG PWNDROP_RELEASE
5+
6+
RUN \
7+
echo "**** install build packages ****" && \
8+
apk add --no-cache \
9+
curl \
10+
g++ \
11+
gcc \
12+
git \
13+
go \
14+
tar
15+
16+
RUN \
17+
echo "**** fetch source code ****" && \
18+
if [ -z ${PWNDROP_RELEASE+x} ]; then \
19+
PWNDROP_RELEASE=$(curl -sX GET "https://api.github.com/repos/kgretzky/pwndrop/releases/latest" \
20+
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
21+
fi && \
22+
mkdir -p \
23+
/tmp/pwndrop && \
24+
curl -o \
25+
/tmp/pwndrop-src.tar.gz -L \
26+
"https://github.com/kgretzky/pwndrop/archive/${PWNDROP_RELEASE}.tar.gz" && \
27+
tar xf \
28+
/tmp/pwndrop-src.tar.gz -C \
29+
/tmp/pwndrop --strip-components=1 && \
30+
echo "**** compile pwndrop ****" && \
31+
cd /tmp/pwndrop && \
32+
go build -ldflags="-s -w" \
33+
-o /app/pwndrop/pwndrop \
34+
-mod=vendor \
35+
main.go && \
36+
cp -r ./www /app/pwndrop/admin
37+
38+
############## runtime stage ##############
39+
FROM lsiobase/alpine:arm32v7-3.11
40+
41+
# set version label
42+
ARG BUILD_DATE
43+
ARG VERSION
44+
ARG PWNDROP_RELEASE
45+
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
46+
LABEL maintainer="aptalca"
47+
48+
# add pwndrop
49+
COPY --from=buildstage /app/pwndrop/ /app/pwndrop/
50+
51+
# add local files
52+
COPY /root /
53+
54+
# ports and volumes
55+
EXPOSE 8080 4443

Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ pipeline {
2626
DOCKERHUB_IMAGE = 'linuxserver/pwndrop'
2727
DEV_DOCKERHUB_IMAGE = 'lsiodev/pwndrop'
2828
PR_DOCKERHUB_IMAGE = 'lspipepr/pwndrop'
29-
DIST_IMAGE = 'ubuntu'
30-
MULTIARCH='false'
29+
DIST_IMAGE = 'alpine'
30+
MULTIARCH='true'
3131
CI='true'
3232
CI_WEB='true'
3333
CI_PORT='8080'

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ The architectures supported by this image are:
5151
| Architecture | Tag |
5252
| :----: | --- |
5353
| x86-64 | amd64-latest |
54+
| arm64 | arm64v8-latest |
55+
| armhf | arm32v7-latest |
5456

5557

5658
## Usage

jenkins-vars.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ repo_vars:
1717
- DOCKERHUB_IMAGE = 'linuxserver/pwndrop'
1818
- DEV_DOCKERHUB_IMAGE = 'lsiodev/pwndrop'
1919
- PR_DOCKERHUB_IMAGE = 'lspipepr/pwndrop'
20-
- DIST_IMAGE = 'ubuntu'
21-
- MULTIARCH='false'
20+
- DIST_IMAGE = 'alpine'
21+
- MULTIARCH='true'
2222
- CI='true'
2323
- CI_WEB='true'
2424
- CI_PORT='8080'

readme-vars.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ project_lsio_github_repo_url: "https://github.com/linuxserver/docker-{{ project_
1010
# supported architectures
1111
available_architectures:
1212
- { arch: "{{ arch_x86_64 }}", tag: "amd64-latest"}
13+
- { arch: "{{ arch_arm64 }}", tag: "arm64v8-latest"}
14+
- { arch: "{{ arch_armhf }}", tag: "arm32v7-latest"}
1315

1416
# development version
1517
development_versions: false

0 commit comments

Comments
 (0)