Skip to content

docker support#117

Open
Tech0ne wants to merge 6 commits intoyarrick:masterfrom
Tech0ne:master
Open

docker support#117
Tech0ne wants to merge 6 commits intoyarrick:masterfrom
Tech0ne:master

Conversation

@Tech0ne
Copy link
Copy Markdown

@Tech0ne Tech0ne commented Jun 23, 2025

Added Dockerfile.server and Dockerfile.client, respectivelly running iodined and iodine on alpine 3.22.0
Build:

  • sudo docker build -t iodined -f Dockerfile.server .
  • sudo docker build -t iodine -f Dockerfile.client .

Usage:

  • sudo docker run -it --rm --device /dev/net/tun --cap-add=NET_ADMIN iodined -f 10.0.0.1 test.com
  • sudo docker run -it --rm --device /dev/net/tun --cap-add=NET_ADMIN iodine -f -r 192.168.0.1 test.com

@yarrick
Copy link
Copy Markdown
Owner

yarrick commented Jun 23, 2025

I tried with podman build and it fails:

STEP 5/8: RUN git clone https://github.com/yarrick/iodine /app/
Cloning into '/app'...
--> 5062214cb419
STEP 6/8: RUN make
make[1]: Entering directory '/app/src'
OS is LINUX, arch is x86_64
CC tun.c
tun.c:19:10: fatal error: stdio.h: No such file or directory
   19 | #include <stdio.h>
      |          ^~~~~~~~~
compilation terminated.

Also I am not sure why this needs to be in this repo and then clone the code again?

@JuniorJPDJ
Copy link
Copy Markdown

It doesn't need to clone code again, it shouldn't - it should copy it from context.

@yarrick
Copy link
Copy Markdown
Owner

yarrick commented Jun 23, 2025

The RUN git clone https://github.com/yarrick/iodine /app/ seems to happen even if it is run in a directory that is already a clone of it.

@JuniorJPDJ
Copy link
Copy Markdown

Yes, but it shouldn't. PR author did wrong thing.

@Tech0ne
Copy link
Copy Markdown
Author

Tech0ne commented Jun 26, 2025

Hello,

Sorry for wasting your time

Originally, I made the Dockerfiles to be self-contained ones, explaining the git clone.

Will update that soon.

@Tech0ne
Copy link
Copy Markdown
Author

Tech0ne commented Jul 1, 2025

From my testing, it now works.

It was tested using Docker.

Please provide errors if any.

(also removed the useless git clone :} )

Hope you'll enjoy !

@yarrick
Copy link
Copy Markdown
Owner

yarrick commented Jul 15, 2025

Can you add multi-stage build to avoid keeping the source code and build tools in the final images?

Also remove all non-essential things from the files (old code, ascii art) and move it into a docker directory?

It seems there is no standardized way of sharing the build step and using it for two different outputs

@Tech0ne
Copy link
Copy Markdown
Author

Tech0ne commented Jul 17, 2025

Copy that, will do ASAP.

Is it ok to keep the ascii art ? Kind of like it tbh :}

And I'll look into build steps, to try and make them as versatile as possible.

@Tech0ne
Copy link
Copy Markdown
Author

Tech0ne commented Jul 18, 2025

Multi stage build added.

Removed useless comments (except ascii art :} )

Moved both client and server Dockerfile to a docker/ directory.

Added build command as comment.

Runner stage also uses ubuntu 24.04.

@yarrick yarrick mentioned this pull request Sep 4, 2025
@leonixyz
Copy link
Copy Markdown

leonixyz commented Sep 4, 2025

Hi, nice work over here!

I did give a try to the code of this PR, and it was missing a package in the final stage: net-tools because ifconfig was needed both by iodine and iodined.

If you git apply this patch it should work. (I also removed the ascii arts)

diff --git a/docker/Dockerfile.client b/docker/Dockerfile.client
index dd8e1f1..af50832 100644
--- a/docker/Dockerfile.client
+++ b/docker/Dockerfile.client
@@ -1,11 +1,3 @@
-##############
-#
-#     @
-#       @
-#   @ @ @
-#
-##############
-
 FROM ubuntu:24.04
 
 RUN apt-get update
@@ -39,5 +31,9 @@ FROM ubuntu:24.04
 
 COPY --from=0 /app/bin/iodine /iodine
 
+RUN apt update && \
+    apt install -y net-tools && \
+    rm -rf /var/lib/apt/lists/*
+
 ENTRYPOINT [ "/iodine" ]
 CMD [ "-h" ]
diff --git a/docker/Dockerfile.server b/docker/Dockerfile.server
index 98aab0a..9dc6ac6 100644
--- a/docker/Dockerfile.server
+++ b/docker/Dockerfile.server
@@ -1,11 +1,3 @@
-##############
-#
-#     @
-#       @
-#   @ @ @
-#
-##############
-
 FROM ubuntu:24.04
 
 RUN apt-get update
@@ -15,6 +7,7 @@ RUN apt-get install -y  \
     git                 \
     libz-dev            \
     make                \
+    net-tools           \
     pkg-config
 
 RUN apt-get clean
@@ -39,5 +32,9 @@ FROM ubuntu:24.04
 
 COPY --from=0 /app/bin/iodined /iodined
 
+RUN apt update && \
+    apt install -y net-tools && \
+    rm -rf /var/lib/apt/lists/*
+
 ENTRYPOINT [ "/iodined" ]
 CMD [ "-h" ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants