Docker meaase saying "another repo already pulling" - docker

I ran the following command in docker:
sudo docker run --name my_mysql -e MYSQL_ROOT_PASSWORD=mysecretpassword -d mysql
When i actually wanted to run the following:
sudo docker run --name my_mysql -e MYSQL_ROOT_PASSWORD=mysecretpassword --volumes-from mydatastore -d mysql
Now after i ran the command(the 1st command) , the only way i could stop it was to close the terminal, soi closed it and then opened the terminal again and ran the second command, I.E.
sudo docker run --name my_mysql -e MYSQL_ROOT_PASSWORD=mysecretpassword --volumes-from mydatastore -d mysql
I get the following message:
"another repository already pulling"(or something similar to this error message ... i just messed up all my docker commands and now i can't seem to re-create this error) , How can i solve this issue ?

Either wait, or restart the docker daemon (probably service docker restart).

Related

docker run - autokill container already in use?

I was following this guide on customizing MySQL databases in Docker, and ran this command multiple times after making tweaks to the mounted sql files:
docker run -d -p 3306:3306 --name my-mysql -v /Users/pneedham/dev/docker-testing/sql-scripts:/docker-entrypoint-initdb.d/ -e MYSQL_ROOT_PASSWORD=supersecret -e MYSQL_DATABASE=company mysql
On all subsequent executions of that command, I would see an error like this:
docker: Error response from daemon: Conflict. The container name "/my-mysql" is already in use by container "9dc103de93b7ad0166bb359645c12d49e0aa4a3f2330b5980e455cec24843663". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
What I'd like to know is whether that docker run command can be modified to auto-kill the previous container (if it exists)? Or if there is a different command that has the same desired result.
If I were to create a shell script to do that for me, I'd first run docker ps -aqf "name=mysql" and if there is any output, use that resulting container ID by running docker rm -f $containerID. And then run the original command.
docker run command has a --rm arguments that deletes the container after the run is completed. see the docs . So, just change your command to
docker run --rm -d -p 3306:3306 --name my-mysql -v /Users/pneedham/dev/docker-testing/sql-scripts:/docker-entrypoint-initdb.d/ -e MYSQL_ROOT_PASSWORD=supersecret -e MYSQL_DATABASE=company mysql

Error response from daemon: container is not running?

I am getting an error message 'Error from daemon: container is not running". Why? I started the container in detached mode, so it should be running? I tried the -it flags for interactivity but that did not work. I also tried sleeping docker but that did not work.
sh "docker run -d --name mongocontainer19"
sh "docker exec mongocontainer19 mongo mongodump"
The --name gives container names, which is mongocontainer19 in your case. So, you didn't put the image name there.
The syntax is
$ docker run [OPTIONS] IMAGE
So the command should be like$ docker run -d --name mongocontainer19 MyRedisIMAGE
--name <Your_container_alias> will be considered as an option of the command. -d or -p xx:xx are options as well.

How to launch the Solr techproducts example on Docker?

I am running solr in docker and I tried the commands from the comment.
docker run --name test -d -p 8983:8983 -t solr
docker exec -it --user=solr test bin/solr create -c techproducts -d sample_techproducts_configs
After the last command, I received the following error message:
Unrecognized argument: example/exampledocs/*.xml .
If this was intended to be a data file, it does not exist relative to /opt/solr
Is this the correct location for the techproducts.xml data?
I looked at the official solr image on hub.docker.com and I found this,
docker run -d -P -v $PWD/myconfig:/myconfig solr solr-create -c mycore -d /myconfig
I guess you need to pass in core configuration from your host with bind mount as in the example. In this case it is not myconfig, it is "sample_techproducts_configs"
I tried the following, it worked for me.
docker run --name my_solr -d -p 8983:8983 -t solr
docker exec -it --user=solr my_solr bin/solr create_core -c
techproducts
docker exec -it --user=solr my_solr bin/post -c techproducts
example/exampledocs/

pact-broker docker image is not running after restarting docker machine

I am using Postgres image and past broker image in my docker machine for setting up pact broker.
here are 4 steps that have mentioned :
1.$ docker run --name pactbroker-db -e POSTGRES_PASSWORD=ThePostgresPassword -e POSTGRES_USER=admin -e PGDATA=/var/lib/postgresql/data/pgdata -v /var/lib/postgresql/data:/var/lib/postgresql/data -d postgres
2.$ docker run -it --link pactbroker-db:postgres --rm postgres sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U admin'
3.
CREATE USER pactbrokeruser WITH PASSWORD 'TheUserPassword';
CREATE DATABASE pactbroker WITH OWNER pactbrokeruser;
GRANT ALL PRIVILEGES ON DATABASE pactbroker TO pactbrokeruser;
4. docker run --name pactbroker --link pactbroker-db:postgres -e PACT_BROKER_DATABASE_USERNAME=pactbrokeruser -e PACT_BROKER_DATABASE_PASSWORD=TheUserPassword -e PACT_BROKER_DATABASE_HOST=postgres -e PACT_BROKER_DATABASE_NAME=pactbroker -d -p 80:80 dius/pact_broker
after running this 4 command when I am opening Hal browser in my local system it is working pretty fine. Now I am stopping 2 docker containers pactbroker-db and pactbroker and stopping docker machine.
After sometime I am restarting docker machine and starting the containers by
$docker start pactbroker-db and $docker start pactbroker .
containers are getting started but when opening HAL browser I am getting the error "We're sorry, but something went wrong." screenshot attached.
Is there something wrong when I am starting the docker 2nd time?enter image description here
This has been resolved by using container given in https://github.com/DiUS/pact_broker-docker and using proper environment variables in docker-compose.yml of this project.

Execute docker command with deis

I have deis(1.5.2) with 3 host and I want "app" with database. I want to use postgres, so I found this docker image https://registry.hub.docker.com/_/postgres/ . I did deploy without problems, but I don't know how can I connect into this app/container (create some db, users) and link with other app/container. They write commands for it but it's for docker. So how can I run these commands from deis:
docker run --name some-app --link some-postgres:postgres -d application-that-uses-postgres
docker run -it --link some-postgres:postgres --rm postgres sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres'
or do you have some other solution for using DB with deis?

Resources