summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2020-04-21 19:58:08 +0200
committerkali kaneko (leap communications) <kali@leap.se>2020-04-30 22:10:24 +0200
commite977c3028d1bb0993b6c5bf29fcfb98b84d0870a (patch)
treede052a9c6c13be05c98945700b8f15b8a14c2af3 /docker
parentb093455df6fb4dc2d9c1339a3ccff0aa6396088b (diff)
[pkg] update to eoan, go versions, add helper script
Diffstat (limited to 'docker')
-rw-r--r--docker/.gitignore1
-rw-r--r--docker/Dockerfile24
-rw-r--r--docker/Makefile1
-rw-r--r--docker/README.md4
-rwxr-xr-xdocker/builder.sh20
5 files changed, 44 insertions, 6 deletions
diff --git a/docker/.gitignore b/docker/.gitignore
new file mode 100644
index 0000000..afea253
--- /dev/null
+++ b/docker/.gitignore
@@ -0,0 +1 @@
+mods/*
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 35f9543..e9d3bc1 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -3,12 +3,12 @@
# we start with 18.04 (bionic) to match the core18 used in the snap
# but we will have to install a couple of extras on top...
-FROM ubuntu:18.04
+FROM ubuntu:18.04 as builder
MAINTAINER LEAP Encryption Access Project <info@leap.se>
-LABEL Description="An image to build Bitmask Lite" Vendor="LEAP" Version="1.1"
+LABEL Description="An image to build Bitmask Lite" Vendor="LEAP" Version="1.2"
ENV OSXSDK_SHA256="631b4144c6bf75bf7a4d480d685a9b5bda10ee8d03dbf0db829391e2ef858789" \
- PATH="$PATH:/osxcross/target/bin"
+ PATH="$PATH:/osxcross/target/bin:/usr/lib/go-1.12/bin"
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
@@ -16,6 +16,7 @@ RUN apt-get update && apt-get upgrade -y && \
make cmake \
git curl wget \
libappindicator3-dev libgtk-3-dev \
+ webkit2gtk-4.0 \
mingw-w64 upx-ucl python snapcraft \
unzip \
devscripts fakeroot debhelper \
@@ -25,17 +26,19 @@ RUN apt-get update && apt-get upgrade -y && \
software-properties-common dh-golang && \
add-apt-repository -y ppa:longsleep/golang-backports && \
apt-get update && \
- apt-get install -y --no-install-recommends golang-1.14-go golang-golang-x-tools-dev
+ apt-get install -y --no-install-recommends golang-1.12-go golang-golang-x-tools-dev && \
+ rm -r /var/lib/apt/lists/*
# version in 18.04 (bionic) is too old
RUN wget http://archive.ubuntu.com/ubuntu/pool/universe/g/golang-x-text/golang-golang-x-text-dev_0.3.2-1_all.deb && \
dpkg -i golang-golang-x-text-dev_0.3.2-1_all.deb
# we also need a newer nsis version
-RUN echo "deb http://de.archive.ubuntu.com/ubuntu disco main universe" >> /etc/apt/sources.list && \
+RUN echo "deb http://de.archive.ubuntu.com/ubuntu eoan main universe" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y --no-install-recommends nsis && \
- sed -i '$ d' /etc/apt/sources.list && apt-get update
+ sed -i '$ d' /etc/apt/sources.list && apt-get update && \
+ rm -r /var/lib/apt/lists/*
# osx cross compiling
RUN git clone https://github.com/tpoechtrager/osxcross && \
@@ -54,3 +57,12 @@ RUN git clone https://github.com/VantaInc/xar && \
cd xar/xar && \
./autogen.sh && ./configure && \
make && sudo make install
+
+# cache go modules
+RUN rm -rf /gomods && mkdir -p /gomods/packages
+WORKDIR /gomods
+COPY mods/go.* /gomods/
+COPY mods/packages/ /gomods/packages/
+RUN go mod download
+
+COPY builder.sh /
diff --git a/docker/Makefile b/docker/Makefile
index d3a13ea..f3e71dd 100644
--- a/docker/Makefile
+++ b/docker/Makefile
@@ -2,6 +2,7 @@ IMAGE=bitmask-vpn
REGISTRY=registry.0xacab.org/leap/docker
build:
+ mkdir -p mods && cp ../go.mod ../go.sum mods/ && cp -r ../packages mods/
docker build -t $(REGISTRY)/$(IMAGE):latest .
push:
docker push $(REGISTRY)/$(IMAGE):latest
diff --git a/docker/README.md b/docker/README.md
new file mode 100644
index 0000000..59fc06f
--- /dev/null
+++ b/docker/README.md
@@ -0,0 +1,4 @@
+You can use the makefile to build the image.
+"make packages" will build packages inside the builder container.
+
+Use https://github.com/kalikaneko/squid-in-a-can if you want to save some bandwith while building your images.
diff --git a/docker/builder.sh b/docker/builder.sh
new file mode 100755
index 0000000..dad7800
--- /dev/null
+++ b/docker/builder.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -e
+export DESTDIR=/bitmask-vpn.orig/deploy/
+rm -rf /bitmask-vpn
+cp -r /bitmask-vpn.orig /bitmask-vpn
+cd /bitmask-vpn
+make prepare
+make build
+case $XBUILD in
+ win)
+ make package_win
+ ;;
+ osx)
+ make package_osx
+ ;;
+ yes)
+ make packages
+ ;;
+esac
+cp /bitmask-vpn/deploy/* $DESTDIR