Open mtilson opened 4 years ago
Thanks for your detailed report!
Interesting. So looking at the diff between 19.03.8 and 19.03.9; https://github.com/moby/moby/compare/v19.03.8...v19.03.9?w=1
Potential suspects could be;
Although I don't think DNS would play a role here (famous last words). I wonder what's the reason the request is blocked by GitHub. I do recall we had an incident recently where changes a combination of changes in Amazon Linux's configuration, and updated botnet-protection rules caused traffic to be blocked https://www.docker.com/blog/docker-hub-incident-review-5-july-2020/ by Docker Hub's CDN. Wondering if (e.g.) requests made with Go 1.13+ differ and cause some detection to be triggered. It's curious that it only affects us-east-2 though 🤔
Have you tried contacting GitHub support if they could see why requests were blocked?
Are you seeing the same problem if you use BuildKit for building? You can enable buildkit by setting the DOCKER_BUILDKIT=1
environment variable on the machine where the client (docker cli) runs (DOCKER_BUILDKIT=1 docker build .....
)
Just a very rudimentary test to check if there's a differences in the request made by Docker 19.03.8 and 19.03.9 when ADD
-ing a file during build (not on AWS, so not taking that into account);
With 19.03.8
GET /index.html HTTP/1.1
Host: <IP-address>:9100
User-Agent: Go-http-client/1.1
Accept-Encoding: gzip
With 19.03.9
GET /index.html HTTP/1.1
Host: <IP-address>:9100
User-Agent: Go-http-client/1.1
Accept-Encoding: gzip
That said, the github downloads would be using TLS, and a redirect
Are you seeing the same problem if you use BuildKit for building? You can enable buildkit by setting the
DOCKER_BUILDKIT=1
environment variable on the machine where the client (docker cli) runs (DOCKER_BUILDKIT=1 docker build .....
)
# DOCKER_BUILDKIT=1 docker build -t test-add-command:19.03.9 .
[+] Building 0.6s (5/6)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 135B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/alpine:latest 0.4s
=> ERROR https://github.com/docker/docker-ce/archive/v19.03.12.tar.gz 0.2s
=> CANCELED [1/2] FROM docker.io/library/alpine:latest@sha256:185518070891758909c9f839cf4ca393ee977ac378609f700f60a771a2dfe321 0.2s
=> => resolve docker.io/library/alpine:latest@sha256:185518070891758909c9f839cf4ca393ee977ac378609f700f60a771a2dfe321 0.0s
=> => sha256:185518070891758909c9f839cf4ca393ee977ac378609f700f60a771a2dfe321 1.64kB / 1.64kB 0.0s
=> => sha256:a15790640a6690aa1730c38cf0a440e2aa44aaca9b0e8931a9f2b0d7cc90fd65 528B / 528B 0.0s
=> => sha256:a24bb4013296f61e89ba57005a7b3e52274d8edd3ae2077d04395f806b63d83e 1.51kB / 1.51kB 0.0s
=> => sha256:df20fa9351a15782c64e6dddb2d4a6f50bf6d3688060a34c4014b0d9a752eb4c 2.80MB / 2.80MB 0.2s
=> => extracting sha256:df20fa9351a15782c64e6dddb2d4a6f50bf6d3688060a34c4014b0d9a752eb4c 0.0s
------
> https://github.com/docker/docker-ce/archive/v19.03.12.tar.gz:
------
failed to solve with frontend dockerfile.v0: failed to build LLB: failed to load cache key: invalid response status 403
Have you tried contacting GitHub support if they could see why requests were blocked?
Here it goes: https://github.community/t/dockerfile-add-command-with-remote-url-on-github-in-a-specific-aws-region/130432
PS: Seems like there is one more involved party ... AWS ))
There is a strange issue with building docker images from
Dockerfile
with commandADD <src>
(when<src>
is remote file URL pointing to GitHub only) which appears on AWS EC2 instances in specific region only (us-east-2
) and related to the latestdocker-ce
versions only (19.03.9
and above). The below examples are provided for Ubuntu 18.04, but the issue is applied to Ubuntu 20.04 too.Expected behavior
docker build
builds image with no issues for the followingdocker-ce
versions5:19.03.12~3-0~ubuntu-bionic
5:19.03.11~3-0~ubuntu-bionic
5:19.03.10~3-0~ubuntu-bionic
5:19.03.9~3-0~ubuntu-bionic
5:19.03.8~3-0~ubuntu-bionic
Actual behavior
docker build
complains onADD
command inDockerfile
for the followingdocker-ce
versions5:19.03.12~3-0~ubuntu-bionic
5:19.03.11~3-0~ubuntu-bionic
5:19.03.10~3-0~ubuntu-bionic
5:19.03.9~3-0~ubuntu-bionic
5:19.03.8~3-0~ubuntu-bionic
Steps to reproduce the behavior
We did the following preparation steps on every tested environments (see Additional environment details (AWS, VirtualBox, physical, etc.) -> Clouds section below for the tested environment instances)
Then we did the tests with
docker-ce 19.03.8
OK everywhere
Then we did the tests with
docker-ce 19.03.9
(and newer ones)OK everywhere except AWS EC2 in region
US East (Ohio) / us-east-2
Not OK for AWS EC2 in region
US East (Ohio) / us-east-2
The issue is related only to remote file URLs pointing to GitHub. If we change remote file URLs in
Dockerfile
to the following, everything is OK everywhere:Output of
docker version
(GCP):Output of
docker info
(GCP):Output of
docker version
(AWS):Output of
docker info
(AWS):Additional environment details (AWS, VirtualBox, physical, etc.)
OS
Clouds
eu-central-1
/ Ubuntu Server 18.04 LTS (HVM), SSD Volume Type:ami-04932daa2567651e7
us-east-1
/ Ubuntu Server 18.04 LTS (HVM), SSD Volume Type:ami-0bcc094591f354be2
europe-west3
/ Canonical, Ubuntu, 18.04 LTS, amd64 bionic image built on 2020-08-21, supports Shielded VM features:ubuntu-1804-bionic-v20200821a
us-east-2
/ Ubuntu Server 18.04 LTS (HVM), SSD Volume Type:ami-0bbe28eb2173f6167
Instance configurations
t2.micro
instance in the first AZ in default VPC with default SG (plus access to the instance by SSH)n1-standard-1
instance indefault
Subnetwork ofdefault
Network (plus access to the instance by SSH)