DEVOPS·중요도 6·2026. 06. 17.·GeekNews

curl 없는 컨테이너에서 Bash /dev/tcp로 HTTP 요청 보내기

── KO ──────────────────

curl 없는 컨테이너에서 Bash를 사용해 HTTP 요청을 보내는 방법 설명.

최소화된 컨테이너 이미지에는 curl이나 wget이 없는 경우가 많습니다. 이럴 때 내부 서비스 연결성을 확인하기 위해 Bash의 /dev/tcp를 이용해 TCP 소켓을 열 수 있습니다. 이를 통해 HTTP/1.1 요청 문자열을 직접 작성하여 요청을 보낼 수 있습니다. 이 방법은 패키지를 설치하지 않고도 HTTP 요청을 수행할 수 있는 유용한 대안이 됩니다.


── EN ──────────────────

How to send HTTP requests using Bash in a container without curl.

Minimized container images often lack curl or wget, necessitating a workaround to verify internal service connectivity. By using Bash's /dev/tcp feature, we can open TCP sockets and manually send HTTP/1.1 request strings. This method provides a useful alternative for making HTTP requests without needing to install additional packages.

원문 보기 →목록으로