diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2ef15c0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +FROM debian:latest + +RUN apt-get update && \ + apt-get install -y --force-yes \ + build-essential \ + wget \ + tar \ + make \ + autoconf \ + automake \ + libtool \ + && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /tmp +RUN wget https://ftp.gnu.org/gnu/inetutils/inetutils-2.0.tar.gz && \ + tar -xzf inetutils-2.0.tar.gz && \ + cd inetutils-2.0 && \ + ./configure --disable-logger --disable-syslogd --disable-whois --disable-rcp --disable-rlogin --disable-rsh --disable-talk --disable-telnet --disable-tftp --disable-uucpd --enable-ping && \ + make && \ + make install && \ + ldconfig + +RUN ping -V + +RUN useradd -m -s /bin/bash devuser && \ + echo "devuser:devuser" | chpasswd + +WORKDIR /home/devuser/ft_ping +USER devuser +CMD ["/bin/bash"] diff --git a/Makefile b/Makefile index fcee903..7e9673f 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: rparodi +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2023/11/12 11:05:05 by rparodi #+# #+# # -# Updated: 2026/03/23 14:53:55 by rparodi ### ########.fr # +# Updated: 2026/03/24 12:38:38 by rparodi ### ########.fr # # # # **************************************************************************** # @@ -23,7 +23,8 @@ RM = rm -rf CFLAGS = -Werror -Wall -Wextra -INC_DIR = ./parsing/includes +INC_DIR = ./includes \ + ./parsing/includes CPPFLAGS = $(addprefix -I, $(INC_DIR)) -MMD -MP @@ -83,7 +84,7 @@ $(OBJDIRNAME)/%.o: %.c @printf '$(GREY) Compiling $(END)$(GREEN)$<$(END)\n' @$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $< -bonus: CFLAGS += -D BONUS=1 +bonus: CPPFLAGS += -D BONUS=1 bonus: re # Header @@ -99,7 +100,7 @@ header: @printf '$(GOLD) ****** ******* ****** $(END)\n' @printf '$(GOLD) ****** $(END)\n' @printf '$(GOLD) ****** $(END)\n' - @printf '$(GREY) Made by glaruell & rparodi$(END)\n\n' + @printf '$(GREY) Made by rparodi$(END)\n\n' # Footer footer: @@ -117,9 +118,14 @@ footer: @printf ' $(GREY)The compilation is$(END) $(GOLD)finish$(END)\n $(GREY)Have a good $(END)$(GOLD)correction !$(END)\n' debug: CPPFLAGS += -D DEBUG=1 -g -# debug: CFLAGS += -fsanitize=address debug: re +d: debug +b: bonus + +db: CPPFLAGS += -D BONUS=1 -D DEBUG=1 -g +db: debug + tmux: @tmux new-session -d -s $(NAME) @tmux send-keys -t $(NAME):0 'vim' C-m diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..1d823d4 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +services: + ft_ping: + build: . + container_name: ft_ping_dev + cap_add: + - NET_RAW + - NET_ADMIN + volumes: + - .:/home/devuser/ft_ping + tty: true