사내 환경 docker 설정법
### 1. Docker 데몬 프록시 설정 (필수)
Docker 데몬 자체가 프록시를 인식하도록 systemd 설정을 수정하세요:
```bash sudo mkdir -p /etc/systemd/system/docker.service.d sudo tee /etc/systemd/system/docker.service.d/http-proxy.conf <<EOF [Service] Environment="HTTP_PROXY=http://사내프록시주소:포트" Environment="HTTPS_PROXY=http://사내프록시주소:포트" Environment="NO_PROXY=localhost,127.0.0.1,사내도메인" EOF sudo systemctl daemon-reload sudo systemctl restart docker ```
- `HTTP_PROXY`/`HTTPS_PROXY`: 사내 프록시 서버 주소와 포트
- `NO_PROXY`: 프록시 예외 대상 (내부 IP/도메인 추가)[5][6][8]
### 2. 미러 설정 재확인
`/etc/docker/daemon.json` 파일에서 미러 구성 검증:
```json
{
"registry-mirrors": ["https://사내미러주소"]
}
``` - **미러 서버 요구사항**:
- Docker Hub의 완전한 미러여야 함
- `docker.io`의 모든 이미지 복제 필요
- 인증 필요 시 미러 서버에 Docker Hub 계정 연동[3]
### 3. 문제 진단 명령어
```bash
docker info | grep -i proxy # 프록시 적용 확인
docker info | grep -i mirror # 미러 설정 확인
docker pull --verbose alpine # 상세 오류 로그 출력 ```
### 4. 추가 해결 방안
- **인증 프록시 사용 시**: URL에 `사용자:비밀번호@프록시주소` 형식 사용[5]
- **미러 작동 불가 시**: 직접 미러 주소 지정 풀링
```bash docker pull 사내미러주소/alpine:latest ```
- **Docker Desktop 사용 시**: GUI 설정 → Resources → Proxies 에서 프록시 지정[5]
> ⚠️ **주의**: `~/.docker/config.json`의 프록시 설정은 **컨테이너 내부** 환경 변수만 제어하며, 데몬 프록시와 무관합니다[1][2]. ### 문제 원인 요약
| 문제 유형 | 원인 | 해결책 | |--———|——|--——|
| **프록시 미설정** | 데몬이 외부 접속 실패 | systemd 프록시 설정 적용[2][5][6] |
| **미러 구성 오류** | 미러가 불완전한 캐시 | 미러 서버 재검증/이미지 동기화[4][7] |
| **인증 문제** | 프록시/미러 인증 실패 | 인증 정보 추가[3][5] |
설정 적용 후 `sudo systemctl restart docker`로 데몬 재시작해야 변경사항이 적용됩니다[2][5]. 프록시 환경에서는 데몬 설정이 반드시 필요하며, 미러 설정만으로는 부족합니다[2][4].
** 추가 **
그래도 pull이 안된다면 이미지 이름에서:tag를 제외하고 {사용자이름}/이미지명 으로 재시도
인용: [1] Proxy configuration https://docs.docker.com/engine/cli/proxy/ [2] Can't pull docker image behind a proxy https://stackoverflow.com/questions/69047394/cant-pull-docker-image-behind-a-proxy/69052052 [3] Docker is not passing auth informations when pulling from a mirror ... https://github.com/moby/moby/issues/30880 [4] Mirror registry for docker images https://kodekloud.com/community/t/mirror-registry-for-docker-images/470712 [5] Daemon proxy configuration https://docs.docker.com/engine/daemon/proxy/ [6] Running Docker behind proxy https://medium.com/@unixslayer/running-docker-behind-proxy-da8394859e5c [7] Docker pull silently ignoring mirror settings - Super User https://superuser.com/questions/1681857/docker-pull-silently-ignoring-mirror-settings [8] How to Configure Docker for Use With a Proxy - LinuxHaxor https://linuxhaxor.net/code/configure-docker-for-use-with-proxy.html [9] Using Docker Behind a Proxy https://www.cloudbees.com/blog/using-docker-behind-a-proxy [10] Docker registry mirror setup https://www.warpbuild.com/blog/docker-mirror-setup [11] Can't pull images behind authenticated proxy with version 17.12.1-ce or greater https://forums.docker.com/t/cant-pull-images-behind-authenticated-proxy-with-version-17-12-1-ce-or-greater/52837 [12] Stuck behind a corporate proxy, cannot get a docker setup ... https://forums.docker.com/t/stuck-behind-a-corporate-proxy-cannot-get-a-docker-setup-to-complete/76606 [13] Docker Proxy Setup using environment variable https://stackoverflow.com/questions/48747772/docker-proxy-setup-using-environment-variable [14] GitHub - peter-mount/docker-mirror: A utility to mirror multiarch docker images between repositories https://github.com/peter-mount/docker-mirror [15] [SOLVED] Cannot pull any image from Docker Hub - General https://forums.docker.com/t/solved-cannot-pull-any-image-from-docker-hub/14119 [16] Pulling Docker Images - Manifest not found - Stack Overflow https://stackoverflow.com/questions/50478077/pulling-docker-images-manifest-not-found [17] Unable to pull DockerHub "library" images from Artifactory mirror ... https://github.com/containerd/containerd/issues/3236 [18] docker registry-mirrors is not used for fqdn images - Server Fault https://serverfault.com/questions/1125551/docker-registry-mirrors-is-not-used-for-fqdn-images [19] How to address a failed docker image pull issue? https://www.silicloud.com/blog/how-to-address-a-failed-docker-image-pull-issue/