Create a docker image/container from EC2 AMI

Here is how I did it. On source AMI locate root volume snapshot id in the description /dev/sda1=snap-eb79b0b1:15:true:gp2 Launch instance with public Ubuntu 14.04 AMI Create volume from snapshot snap-eb79b0b1 (in the same region that the instance runs). Attach volume to the instance as /dev/sdf mount volume to /mnt mount /dev/xvdf /mnt (or) mount /dev/xvdf1 … Read more

docker local registry “exec: \”htpasswd\”: executable file not found in $PATH”

It will continue to work if you pin the local docker registry to registry:2.7.0 instead of picking up the latest version 2 by just using registry:2 which is sadly broken for details see https://github.com/docker/distribution-library-image/commit/ab00e8dae12d4515ed259015eab771ec92e92dd4 (they removed package apache2-utils) and https://github.com/GoogleContainerTools/jib/pull/2538/commits/f816c837e34eb389c2cdee1bc9a2918c5d2e33e3 and https://github.com/GoogleContainerTools/jib/pull/2539 as referenced in https://github.com/docker/distribution-library-image/issues/106 alternatively, instead of executing htpasswd from inside registry:2 you … Read more

Docker show current registry

There’s no concept of a “current” registry – full image tags always contain the registry address, but if no registry is specified then the Docker Hub is used as the default. So docker push user/app pushes to Docker Hub. If you want to push it to a local registry you need to explicitly tag it … Read more

Pull docker images from a private repository during docker build?

I was facing the same issue in 2019. I solved this using arguments (ARG). https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact Arguments allow you to set optional parameters (with defaults) that can be used in your FROM line. Dockerfile-project-dev ARG REPO_LOCATION=privaterepo.company.net/ ARG BASE_VERSION=latest FROM ${REPO_LOCATION}project/base:${BASE_VERSION} … For my use-case I normally want to pull from the private repo, but if I’m … Read more

Docker parallel operations limit

The options are set in the configuration file (Linux-based OS it is located in the path: /etc/docker/daemon.json and C:\ProgramData\docker\config\daemon.json on Windows) Open /etc/docker/daemon.json (If doesn’t exist, create it) Add the values(for push/pulls) and set parallel operations limit { “max-concurrent-uploads”: 1, “max-concurrent-downloads”: 1 } Restart daemon: sudo service docker restart

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)