How to push a docker image to Heroku, which is pulled from Docker Hub - heroku

after pushing it to heroku how to run the command "docker run -d --hostname my-rabbit --name some-rabbit rabbitmq:3-management"

Heroku may have provided you the private docker repository URL, change docker image name to REPO_URL/rabbitmq:3-management

Related

Can't connect near-cli with near in local mode

I ran indexer in local mode as a docker container and also had a container with near-cli.
sudo docker run -it --name indexer --rm -v indexer_data:/near indexer run
sudo docker run --name near-cli --rm -it --volumes-from indexer:ro near-cli bash
Both are in the same network. All configured fine.
How can I make a request from near-cli container to the indexer? I try to do something like inside near-cli container:
NEAR_ENV=local NEAR_NODE_URL=http://indexer:3030 near create-account fomo.test.near --initialBalance 50 --masterAccount test.near --keyPath=/near/validator_key.json
but it doesn't work.
I found solution:
NEAR_ENV=local NEAR_CLI_LOCALNET_RPC_SERVER_URL=http://<ip-address>:3030 near create-account fomo.test.near --initialBalance 50 --masterAccount test.near --keyPath=/near/validator_key.json

docker images listed, but not able to delete

i am trying to run container using image, but it doesn't detect image locally. whereas the images are listed as shown below. To recover i thought of deleting and re-running. But, i get error in deleting the listed image:
Also, I will like to highlight that i have uninstalled and re-installed docker between first time and 2nd time running the below cmd to start container.
Here is the sequence of steps i have done:
Command to run container (which downloaded image when i ran it first)
docker container run --name jenkins-docker --rm --detach \
> --privileged --network jenkins --network-alias docker \
> --env DOCKER_TLS_CERTDIR=/certs \
> --volume jenkins-docker-certs:/certs/client \
> --volume jenkins-data:/var/jenkins_home \
> --volume "$HOME":/home docker:dind
Uninstalled and re-installed docker
Re-run above cmd to start conatiner (got below error)
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See 'docker run --help'.
list image
REPOSITORY TAG IMAGE ID CREATED SIZE
jenkinsci/blueocean latest b9a3e09d0e84 22 hours ago 549MB
docker dind 8489eeb24a26 4 days ago 237MB
Validate that no container is running
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Deleting images :
Error: No such image: b9a3e09d0e84
docker rmi 8489eeb24a26
Error: No such image: 8489eeb24a26
to force delete all containers, run:
docker rm -f $(docker ps -a -q)
to force delete all images, run:
docker rmi -f $(docker images -a -q)
to check containers have been deleted, run:
docker ps -a
to check images have been deleted, run
docker images -a
you can see errors like following at image deletion time, but you'll see by running docker images -a that there is nothing left
Error: No such image: 1203fc0eeda3
Had a similar issue where podman created an image duplicate listed as
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> b6513bbf3672 7 minutes ago 116 MB
Force deleting with
docker rmi -f $(docker images -a -q)
as suggested by fredericrous solved it!

is there any way to run a docker image on host from other docker image? [duplicate]

I am using a docker container to build and deploy my software to a collection of ec2's. In the deployment script I build my software and then package it in a docker image. The image is pushed to my private registry, pulled by my production ec2's and then run. So essentially I will need to run docker within a docker container.
The problem is that I can't actually start docker on my container. If I try
service docker start
I get
bash: service: command not found
And if I try
docker -d
I get
2014/10/07 15:54:35 docker daemon: 0.11.1-dev 02d20af/0.11.1; execdriver: native; graphdriver:
[e2feb6f9] +job serveapi(unix:///var/run/docker.sock)
[e2feb6f9] +job initserver()
[e2feb6f9.initserver()] Creating server
2014/10/07 15:54:35 Listening for HTTP on unix (/var/run/docker.sock)
[error] attach_loopback.go:42 There are no more loopback device available.
loopback mounting failed
[e2feb6f9] -job initserver() = ERR (1)
2014/10/07 15:54:35 loopback mounting failed
The service command doesn't exist on the docker container so I can't start docker. I'm not sure what I should be doing now to start docker so I'm a bit stuck here, any help is appreciated.
A bit more information
Host machine is running fedora 20 (will eventually be running amazon linux on an ec2)
Docker container is running centos 7.0
Host is running Docker version 1.2.0, build fa7b24f/1.2.0
Container is running docker-0.11.1-22.el7.centos.x86_64
How about not running 'docker inside docker' and run docker on your host, but from within your docker container? Just mount your docker.sock and docker binary:
docker run -v /var/run/docker.sock:/run/docker.sock -v $(which docker):/bin/docker [your image]
https://github.com/sameersbn/docker-gitlab uses this approach to spin up docker containers, take a look at this image.
You can also take a look at: https://registry.hub.docker.com/u/mattgruter/doubledocker/
UPDATE on july 2016
The most current approach is to use docker:dind image, as described here:
https://hub.docker.com/_/docker/
Short summary:
$ docker run --privileged --name some-docker -d docker:dind
and then:
$ docker run --rm --link some-docker:docker docker info
While in almost all cases I would suggest following #cthulhu's answer and not running "docker in docker", in the cases when you must (e.g. a test suite which tests against multiple docker version), use the following to create additional loopback devices:
#!/bin/bash
for i in {0..6}
do
mknod -m0660 /dev/loop$i b 7 $i
done
(Taken from the thread for Docker Issue #7058)
You can simply run docker inside the docker container using dind. Try this image from Jerome, as follows:
docker run --privileged -t -i jpetazzo/dind
Check this page for more details:
https://github.com/jpetazzo/dind

Deploy Existing Docker Image To Heroku

I am unable to deploy an existing docker image to Heroku.
Image
docker run -it --name xp-home enonic/xp-home
docker run -d -p 8080:8080 --volumes-from xp-home --name xp-app enonic/xp-app
The steps I took to do it.
heroku login
sudo heroku container:login
sudo docker tag dpd-image registry.heroku.com/hidden-mountain-63983/web
sudo docker push registry.heroku.com/hidden-mountain-63983/web
heroku open -a hidden-mountain-63983
What Am I doing wrong here?
Thank you in advance
I'll answer this for others that might have the same question.
As per the Heroku Container Registry & Runtime (Docker Deploys) documentation, you need to release the image. In your case
heroku container:release registry.heroku.com/hidden-mountain-63983/web

Docker can't pull image from repository

I have trouble with docker.
Im trying to create a new instance of rethinkdb on docker. I used the origin command from dockerfile github.
$ docker run -d -p 8080:8080 -p 28015:28015 -p 29015:29015 dockerfile/rethinkdb
But it returned error about image not found from the repository.
Any advice for this issue?
Thank everyone
OS version: Windows 10
Screenshot
That github repo doesn't appear to have been updated in a few years, and all the docker hub links are old. Consider using the official repo on docker hub:
docker run -d -p 8080:8080 -p 28015:28015 -p 29015:29015 rethinkdb

Resources