Skip to content

Instantly share code, notes, and snippets.

[Troubleshooting] Docker 컨테이너에서 apt update 실패 문제 해결

이 문서는 Docker 컨테이너 내에서 인터넷 연결은 되지만 apt update와 같이 도메인 이름을 사용하는 명령어가 실패하는 문제의 원인과 해결 방법을 기록합니다.

1. 문제 상황 (Symptom)

  • Docker 컨테이너의 셸(bin/shell)에 접속하여 apt update를 실행하면 저장소 주소를 찾지 못하고 Ign (Ignore) 메시지만 뜨면서 멈추는 현상 발생.
  • 하지만 curl 1.1.1.1과 같이 IP 주소로 직접 통신을 시도하면 정상적으로 응답을 받아옴.

문제 발생 시 출력

#!/usr/bin/env python3
# This code is based on tutorial by slicktechies modified as needed to use oauth token from Twitch.
# You can read more details at: https://www.junian.net/2017/01/how-to-record-twitch-streams.html
# original code is from https://slicktechies.com/how-to-watchrecord-twitch-streams-using-livestreamer/
# 24/7/365 NAS adaptation by CuriousTorvald (https://gist.github.com/curioustorvald/f7d1eefe1310efb8d41bee2f48a8e681)
# Twitch Helix API integration by Krepe.Z (https://gist.github.com/krepe90/22a0a6159b024ccf8f67ee034f94c1cc)
# Copyright © 2017, 2019, 2020, 2022 Junian, CuriousTorvald and Krepe.Z
#