์•ž์„œ ๋งŒ๋“  ๋ฌธ์ œ์— ๋Œ€ํ•œ ๋„์ปคํŒŒ์ผ์„ ์ œ์ž‘ํ•ด๋ณด์ž.

๋ฌด์‚ฌํžˆ ์ต์Šค๊ฐ€ ๋˜๋ฉด ์ข‹๊ฒ ๋‹ค..

port์ฃผ์†Œ๋Š” 2331๋กœ ์„ค์ •ํ–ˆ๋‹ค.

 

Dockerfile

FROM ubuntu:18.04

RUN dpkg --add-architecture amd64
RUN apt update
RUN apt install -y xinetd
ENV TERM=linux

RUN useradd egg

ADD xinetd /etc/xinetd.d/
ADD share /home/egg

RUN chmod 460 /home/egg/*

RUN chown injection:root /home/egg/*
RUN chmod +x /home/egg/egg
RUN chmod +x /home/egg/run.sh

CMD ["/usr/sbin/xinetd","-dontfork"]

 

docker-compose.yml

version: '3'

services:
    ctf:
      build: .
      ports:
        - "2331:2331"

 

xinetd

service ctf
{
	disable = no
	type = UNLISTED
	wait = no
	server = /home/egg/run.sh
	socket_type = stream
	protocol = tcp
	user = user
	port = 2331
	flags = REUSE

}
๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค!