diff --git a/Dockerfile.client b/docker/Dockerfile.client similarity index 68% rename from Dockerfile.client rename to docker/Dockerfile.client index 23e0a01..a388962 100644 --- a/Dockerfile.client +++ b/docker/Dockerfile.client @@ -6,19 +6,7 @@ # ############## -# FROM alpine:3.22.0 -# -# RUN apk update -# RUN apk add --no-cache \ -# gcc \ -# git \ -# linux-headers \ -# make \ -# musl-dev \ -# pkgconfig \ -# zlib-dev - -FROM ubuntu:24.04 +FROM ubuntu:24.04 AS builder RUN apt-get update @@ -37,6 +25,8 @@ COPY . /app/ RUN make +# build command (at repo root): [sudo] docker build -t iodine -f docker/Dockerfile.client . + # iodine require /dev/net/tun from the host. # run the container with --device /dev/net/tun --cap-add=NET_ADMIN to allow it @@ -45,5 +35,9 @@ RUN make # --cap-add=NET_ADMIN \ # iodine -f -r 192.168.0.1 -P "password" test.com -ENTRYPOINT [ "/app/bin/iodine" ] +FROM ubuntu:24.04 + +COPY --from=0 /app/bin/iodine /iodine + +ENTRYPOINT [ "/iodine" ] CMD [ "-h" ] diff --git a/Dockerfile.server b/docker/Dockerfile.server similarity index 73% rename from Dockerfile.server rename to docker/Dockerfile.server index 41de5b3..3289c10 100644 --- a/Dockerfile.server +++ b/docker/Dockerfile.server @@ -6,17 +6,7 @@ # ############## -# FROM alpine:3.22.0 -# -# RUN apk update -# RUN apk add --no-cache \ -# gcc \ -# make \ -# musl-dev \ -# pkgconfig \ -# zlib-dev - -FROM ubuntu:24.04 +FROM ubuntu:24.04 AS builder RUN apt-get update @@ -35,6 +25,8 @@ COPY . /app/ RUN make +# build command (at repo root): [sudo] docker build -t iodined -f docker/Dockerfile.server . + # iodine require /dev/net/tun from the host. # run the container with --device /dev/net/tun --cap-add=NET_ADMIN to allow it @@ -43,5 +35,9 @@ RUN make # --cap-add=NET_ADMIN \ # iodined -f 10.0.0.1 -P "password" test.com -ENTRYPOINT [ "/app/bin/iodined" ] +FROM ubuntu:24.04 + +COPY --from=0 /app/bin/iodined /iodined + +ENTRYPOINT [ "/iodined" ] CMD [ "-h" ]