diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..521c4686 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM debian:bullseye-20230208-slim + +WORKDIR /opt + +RUN apt update + +RUN apt install -y \ + git autoconf automake pkg-config gcc g++ libssl-dev make ppp-dev pppoe + +COPY . ./ + + +RUN ./autogen.sh && \ + ./configure --prefix=/usr/local --sysconfdir=/etc --disable-dependency-tracking && \ + make && make install + +ENTRYPOINT ["/usr/local/bin/openfortivpn"] + +CMD ["-c", "/etc/openfortivpn/config"] diff --git a/README.md b/README.md index fd542430..a599b2a3 100644 --- a/README.md +++ b/README.md @@ -174,6 +174,25 @@ For other distros, you'll need to build and install from source: Finally, install runtime dependency `ppp` or `pppd`. +Docker +---------------- + +Build + +```bash +docker build . -t openforticlient +``` +Run +```bash +docker run --privileged --cap-add=NET_ADMIN --net host -d -v config:/etc/openfortivpn/config openforticlient +``` + +or with parameters + +```bash +docker run --privileged --cap-add=NET_ADMIN --net host -d -v config:/etc/openfortivpn/config openforticlient -c /etc/openfortivpn/config --set-dns=0 --pppd-use-peerdns=1 +``` + Running as root? ----------------