Here is some notes about Docker I learned today.
How to solve the “Failed to fetch archive.ubuntu.com” problem
This problem happens when I create a Dockerfile based on the base “Ubuntu” image and want to run “apt-get update && apt-get install -y something” on it. When executing the “apt-get update” step of during Docker building process, it always reports error like “Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/InRelease” and so on.
Google and find posts like here and here. But the problem is still there. The final solution comes from here. The key is that, besides enabling the DNS arguments of Docker, I need to use the specific DNS server of my environment instead of the default Google DNS server. Here is the steps.
1 2 3 4 5 6 7 8
How to attach to a running container with bash
Run the following command:
How to pass arguments to command when starting a container instance
For an exampleRun the following commands:
How to copy file from containter to host