FROM alpine AS builder
RUN apk --no-cache add build-base cmake linux-headers

WORKDIR /usr/src/app
COPY . .
RUN cmake -DCMAKE_BUILD_TYPE=Release .
RUN make

FROM alpine
COPY --from=builder /usr/src/app/tun .

RUN ["./tun"]