Skip to content

Commit

Permalink
Init (#2)
Browse files Browse the repository at this point in the history
## What
* Created pritunl container

## Why
* To run pritunl on k8s
  • Loading branch information
goruha authored Sep 9, 2019
1 parent 9bd0a68 commit bf7f6c4
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Override for Makefile
[{Makefile, makefile, GNUmakefile}]
indent_style = tab
indent_size = 4

[Makefile.*]
indent_style = tab
indent_size = 4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build-harness/
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
sudo: required
addons:
apt:
packages:
- git
- make
- curl
env:
- DOCKER_IMAGE_NAME=cloudposse/pritunl
services:
- docker
install:
- make init
- make docker/login

script:
- make docker/build

after_success:
- make travis/docker-tag-and-push
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM ubuntu:16.04

ENV DEBIAN_FRONTEND noninteractive

ENV PRITUNL_CONFIG=
ENV PRITUNL_MAIN_CONFIG=/etc/pritunl.conf

EXPOSE 9700
EXPOSE 443
EXPOSE 80
EXPOSE 1194

ENTRYPOINT ["/init"]

ENV VERSION="1.29.1979.98"

RUN echo 'deb http://repo.pritunl.com/stable/apt xenial main' > /etc/apt/sources.list.d/pritunl.list \
&& echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" > /etc/apt/sources.list.d/openvpn-aptrepo.list \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 42F3E95A2C4F08279C4960ADD68FA50FEA312927 \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 8E6DA8B4E158C569 \
&& apt-get update -q \
&& apt-get install locales \
&& locale-gen en_US en_US.UTF-8 \
&& dpkg-reconfigure locales \
&& ln -sf /usr/share/zoneinfo/UTC /etc/localtime \
&& apt-get upgrade -y -q \
&& apt-get dist-upgrade -y -q \
&& apt-get -y install pritunl iptables \
&& apt-get clean \
&& apt-get -y -q autoclean \
&& apt-get -y -q autoremove \
&& rm -rf /tmp/*

ADD rootfs /
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright {yyyy} {name of copyright owner}
Copyright 2017-2019 Cloud Posse, LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SHELL = /bin/bash
export BUILD_HARNESS_PATH ?= $(shell until [ -d "build-harness" ] || [ "`pwd`" == '/' ]; do cd ..; done; pwd)/build-harness
-include $(BUILD_HARNESS_PATH)/Makefile

.PHONY : init
## Init build-harness
init:
@curl --retry 5 --retry-delay 1 https://raw.githubusercontent.com/cloudposse/build-harness/master/bin/install.sh | bash

.PHONY : clean
## Clean build-harness
clean:
@rm -rf $(BUILD_HARNESS_PATH)
9 changes: 9 additions & 0 deletions rootfs/init
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
[ "${MONGODB_URI}" ] && pritunl set-mongodb ${MONGODB_URI}

if [ -f "${PRITUNL_CONFIG}" ]; then
cat ${PRITUNL_CONFIG} | xargs -n 2 pritunl set
fi


exec env GODEBUG=netdns=cgo /usr/bin/pritunl start

0 comments on commit bf7f6c4

Please sign in to comment.