Skip to content

Instantly share code, notes, and snippets.

@ihciah
Created October 3, 2023 06:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihciah/51774796fe74782f59bbf2b2cbe224be to your computer and use it in GitHub Desktop.
Save ihciah/51774796fe74782f59bbf2b2cbe224be to your computer and use it in GitHub Desktop.
Tinc Dockerfile
FROM alpine:latest
ENV DEV_PACKAGES="build-base make zlib-dev lzo-dev libressl-dev linux-headers ncurses-dev readline-dev"
ENV TINC_VERSION=4c6a9a9611442f958c3049a566ac4369653978e9
RUN cd /tmp && \
wget https://github.com/gsliepen/tinc/archive/${TINC_VERSION}.tar.gz && \
tar -xzf ${TINC_VERSION}.tar.gz && \
cd tinc-${TINC_VERSION} && \
.ci/deps.sh && \
mkdir -p /tmp/target && \
meson setup "/tmp/target" -Dbuildtype=release -Dminiupnpc=auto -Djumbograms=true -Dtunemu=enabled -Duml=true -Dprefix=/usr -Dsysconfdir=/etc -Dlocalstatedir=/var && ninja -C "/tmp/target" && \
/tmp/target/src/tinc --version
FROM alpine:latest
RUN apk add readline lzo lz4-libs vde2-libs net-tools iproute2 nftables iptables curl \
&& mkdir -p /usr/local/tinc /var/local/run
COPY --from=0 /tmp/target/src/tinc /usr/sbin/tinc
COPY --from=0 /tmp/target/src/tincd /usr/sbin/tincd
VOLUME /etc/tinc
ENV NET_NAME default
CMD exec tincd -n $NET_NAME -D
FROM alpine:edge
ENV TINC_VERSION=1.1pre18
### Dependencies Installation
RUN set -x && \
echo 'http://dl-4.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories && \
apk update && \
apk add -t .tinc-build-deps \
autoconf \
build-base \
curl \
g++ \
gcc \
libc-utils \
libpcap-dev \
libressl \
linux-headers \
lzo-dev \
make \
ncurses-dev \
openssl-dev \
readline-dev \
tar \
zlib-dev \
&& \
\
apk add -t .tinc-run-deps net-tools iproute2 nftables iptables \
ca-certificates \
libcrypto1.1 \
libpcap \
lzo \
openssl \
readline \
zlib && \
\
mkdir -p /usr/src/tinc && \
curl http://www.tinc-vpn.org/packages/tinc-${TINC_VERSION}.tar.gz | tar xzvf - --strip 1 -C /usr/src/tinc && \
cd /usr/src/tinc && \
./configure --prefix=/usr --enable-jumbograms --enable-tunemu --sysconfdir=/etc --localstatedir=/var && \
make && make install src && \
apk del --no-cache --purge .tinc-build-deps && \
mkdir /var/log/tinc && \
rm -rf /usr/src/tinc && \
rm -rf /var/cache/apk/*
VOLUME /etc/tinc
ENV NET_NAME default
CMD exec tincd -n $NET_NAME -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment