Docker - Can't push on my registry when using S3 configuration - amazon-ec2

I'm trying to set up my own docker registry on a amazon ec2.
If I launch it such as:
docker run -p 5000:5000 registry
it's working without any problem.
However when I try to launch it with s3 using my credential such as:
docker run -p 5000:5000 -e SETTINGS_FLAVOR=s3 -e AWS_REGION=eu-west-1 -e AWS_BUCKET=$BUCKET -e STORAGE_PATH=/registry -e AWS_KEY=$AWS_KEY -e AWS_SECRET=$AWS_SECRET registry
I get
alexis#ubuntu:/home/web$ sudo docker push amazon.ip:5000/web
2014/10/07 00:57:38 Error: Invalid Registry endpoint: Get http://amazon.ip:5000/v1/_ping: dial tcp amazon.ip:5000: connection refused
Thanks for your help

Related

windows redis-client connect to docker server failed

I am using windows10, redis-64bit, I started a redis container with command:
docker run --name myredis -d redis redis-server --appendonly yes
when I try to connect to this container using:
redis-cli -h 192.168.99.1 -p 6379
it shows:
Could not connect to Redis at 192.168.99.1:6379: Unknown error
here, 192.168.99.1 is my virtual machine ip address, anyone know how to solve this issue, thanks!
To connect to a redis container from a remote server you should do the following:
Start redis container on host (192.168.99.1):
docker run --name myredis -p 7000:6379 -d redis redis-server
Connect via remote server:
redis-cli -h 192.168.99.1 -p 7000

Error while running postgres container "Error response from daemon: invalid mode: /var/lib/postgresql/data."

I'm trying to run a postgres docker container on Windows 10.
I've installed postgres using the Linux container as I couldn't do so using the Windows container.
While running the below in powershell
docker run -d --name pg-flowthru --env-file ./database/env.list -p 5432:5432 --rm -v ${PWD}:/docker/volumes/postgres:/var/lib/postgresql/data postgres
(env.list contains database credentials), I'm getting the below error:
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: invalid mode: /var/lib/postgresql/data.
See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.
C drive is already in the "Shared Drives" in Docker Desktop
I think this may be an issue with path, but I'm new to docker and can't figure it out.
From here
More info here
A volume has to be created first:
docker volume create postgresql-volume
The postgres container can now be run using the previously created volume:
docker run -d --name pg-flowthru --env-file ./database/env.list -p 5432:5432 -v 'postgresql-volume:/var/lib/postgresql/data' postgres
Listing the running containers now shows the above container running.

freeswtich docker container connectivity

I am trying to run the docker container for freeswitch from the following URL
https://hub.docker.com/r/bettervoice/freeswitch-container/
When i issue the following command
CID=$(sudo docker run --name freeswitch -p 5060:5060/tcp -p 5060:5060/udp -p 5080:5080/tcp -p 5080:5080/udp -p 8021:8021/tcp -p 7443:7443/tcp -p 60535-65535:60535-65535/udp -v /home/ubuntu/freeswitch/conf:/usr/local/freeswitch/conf bettervoice/freeswitch-container:1.6.6)
After a while the following error is displayed
docker: Error response from daemon: driver failed programming external connectivity on endpoint freeswitch (d805c283f72bc75752a0eb354195e4c7b606b54fed604d238df826261ceeeb43): Error starting userland proxy:.
ERRO[0509] error waiting for container: context canceled
Please help.

Connecting to rethinkdb (or any other app running on an http port) from the Docker OS X beta

I've installed the Docker for Mac beta which allows you to use docker commands directly. I want to try to run rethinkdb through docker, so I've followed the instructions of the rethinkdb docker container docs and done the following:
docker run --name some-rethink -v "$PWD:/data" -d rethinkdb
This works, and I can see the container with docker ps and start shell with docker exec -it /bin/bash
However, I can't connect to the admin panel on my Mac directly with their suggestion
$BROWSER "http://$(docker inspect --format \
'{{ .NetworkSettings.IPAddress }}' some-rethink):8080"
This essentially amounts to google-chrome http://172.17.0.2:8080/, but this doesn't work. I asked around and was told
You can't use the docker private ip address space to access the ports
You have to forward them to the mac
However, I'm not sure how to do this as I don't have any port forwarding tools I'm familiar with such as ssh on the container itself. Using the suggested port forwarding command in the rethinkdb container docs ssh -fNTL ... but with localhost instead of remote does not work.
How can I connect to the rethinkdb admin panel through http with the docker beta on a Mac?
Try forwarding the container port using the -p flag in the docker run command, e.g.:
docker run -p 8080:8080 --name some-rethink -v "$PWD:/data" -d rethinkdb
and then it should be accessible on localhost,
google-chrome http://127.0.0.1:8080/
Relevant docker run docs: https://docs.docker.com/engine/reference/run/#/expose-incoming-ports

Docker private registry issue

I run private registry on UBUNTU 14.04:
docker run -d -p 5000:5000 registry
The proces appeard on my docker proces list. I wrote command : curl my-external-ip and I got this:
"\"docker-registry server\""
THE PROBLEM IS that
when I try to push image on localhost it works fine, but after I want to push to external ip (It must be available for for more people) I got this:
The push refers to a repository [MY-EXTERNAL-IP:5000/hello] (len: 1)
unable to ping registry endpoint https://MY-EXTERNAL-IP:5000/v0/
v2 ping attempt failed with error: Get https://MY-EXTERNAL-IP:5000/v2/: EOF
v1 ping attempt failed with error: Get ht*ps://MY-EXTERNAL-IP:5000/v1/_ping: EOF
I am using proxy at my company, but I added export http_proxy, https_proxy, ftp_proxy to my docker file and --insecure-registry.
It looks that your docker daemon can't access docker registry(your-external-ip) through https protocol(usually it uses 443 port).
Maybe you can check it first.
But with insecure mode, the network occured on http protocol. So you can tell you docker daemon to trust insecure-registry.
Try to run docker daemon with --insecure-registry="YOUR_EXTERNAL_IP"
It seems like your Docker daemon still doesn't understand that registry on your $EXTERNAL_IP should be accessed over HTTP rather than HTTPS. You need to be sure that daemon runs with the --insecure-registry $EXTERNAL_IP option:
ps aux | grep docker
If you'll not be able to find it there, you probably made a mistake in your DOCKER_OPTIONS.

Resources