Error while pushing a Docker image into Cloud Foundry - docker

I am trying to push a Docker image (public) into Cloud Foundry, but got the
following error message.
FAILED
Error restarting application: Server error, status code: 500, error code: 170011, message: Stager error: Failed to open TCP connection to stager.service.cf.internal:8888 (getaddrinfo: Name or service not known)

I got the same issue, CF installed with bosh-lite according to pivotal docs.
commands:
cf enable-feature-flag diego_docker
cf push app1 -o localhost:5000/app1:1
docker registry setup:
docker pull registry:2
docker run --name reg2 -d --restart=always -p 5000:5000 registry:2
docker image app1 tagged and pushed w/o any issues.

Related

Docker installation on Mac m1

I am trying to install Docker desktop on Mac m1 but after installation dockers asks to execute following command.
docker run -d -p 80:80 docker/getting-started
But, it gives following error
Unable to find image 'docker/getting-started:latest' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": read tcp 192.168.65.4:58764->192.168.65.5:3128: read: connection reset by peer.
See 'docker run --help'.
Why is it not pulling docker data?
(Sorry for the miss... going to try this again)
Try docker exec command before your command.
Like this docker exec docker run -d -p 80:80 docker/getting-started
"Tried using the docker exec command and it appears to have worked OK with two different ubuntu instances. Did not try Docker Desktop.
It kind of looks like there is a problem with Docker Desktop manipulating Terminal.app.
I’m using the macOS default zshell."
https://forums.docker.com/t/problems-getting-started/116487/9

Local ci pipeline with gitlab using docker

I installed gitlab via docker locally successfully on port 9800 in an own network "cinet". Now I would like to set up a ci pipeline. For that I first have to install a gitlab-runner and then to register it. The registration fails, however.
Starting gitlab like so
$ docker run --name=gitlab --volume="/srv/gitlab/config:/etc/gitlab" --volume="/srv/gitlab/logs:/var/log/gitlab" --volume="/srv/gitlab/data:/var/opt/gitlab" -p 9800:80 -p 22:22 -p 443:443 --network=cinet --restart=no --detach=true gitlab/gitlab-ce:latest
The gui is ready under http://localhost:9800. I created a java maven projekts with a .gitlab-ci.yml and pushed it into my local gitlab instance successfully. The ci pipeline is stuck as expected since there is no runner yet intalled/registered.
Installing the runner
$ docker run -d --name gitlab-runner --restart always -v /srv/gitlab-runner/config:/etc/gitlab-runner -v /var/run/docker.sock:/var/run/docker.sock --network=cinet gitlab/gitlab-runner
Registering the runner. I first tried a shared runner and obtained the token from the ci gui.
$ docker run --rm -t -i -v /srv/gitlab-runner/config:/etc/gitlab-runner --network=cinet gitlab/gitlab-runner register
The I am prompted for host, token, description and tags. Tags I left empty. For host I tried:
http://localhost:9800/ - That results in the following error:
ERROR: Registering runner... failed runner=Lt7NVbJ_ status=couldn't execute POST against http://localhost:9800/api/v4/runners: Post http://localhost:9800/api/v4/runners: dial tcp 127.0.0.1:9800: connect: connection refused
PANIC: Failed to register this runner. Perhaps you are having network problems
http://172.19.0.2:9800/ - That results in the following error:
ERROR: Registering runner... failed runner=Lt7NVbJ_ status=couldn't execute POST against http://172.19.0.2:9800/api/v4/runners: Post http://172.19.0.2:9800/api/v4/runners: dial tcp 172.19.0.2:9800: connect: connection refused
PANIC: Failed to register this runner. Perhaps you are having network problems
Why is that failing? What do I need to do to make that run?

Failed to pull image from Docker local insecure registry: http: server gave HTTP response to HTTPS client

when I try to deploy application in Kubernetes using images in my private Docker registry on same server (master node), I receive following error:
Failed to pull image
"0.0.0.0:5000/continuous-delivery-tutorial:5ec98331a69ec5e6f818583d4506d361ff4de89b-2020-02-12-14-37-03":
rpc error: code = Unknown desc = Error response from daemon: Get
https://0.0.0.0:5000/v2/: http: server gave HTTP response to HTTPS
client
When I print docker system info I can see there is my registry as insecure registry:
I run my registry by following command:
docker run -d -p 5000:5000 --restart=always --name registry -v $PWD/docker_reg_certs:/certs -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key registry:2
Thank you for any advice
you need to add your hostname to the list of allowed insecure registries in /etc/docker/daemon.json, for example:
{
"insecure-registries" : ["your-computer-hostname:5000"]
}
(this file is supposed to contain 1 json object, so if it's not empty then add insecure-registries property to the existing object instead of creating a new one. Also remember to restart your docker daemon afterwards)
also, you should not use 0.0.0.0 as it is not a real address. use your hostname instead when specifying image, like your-computer-hostname:5000/continuous-delivery-tutorial:5ec98331a69ec5e6f818583d4506d361ff4de89b-2020-02-12-14-37-03

need to get the images from docker to run in kubernetes error certificate signed by unknown authority

am trying to run a kubernetes cluster in my local machine.I have Installed kubectl,docker toolbox,minikube and virtual box .
Before docker build:
minikube docker env
Did a docker build and am trying to push the docker image in local registry:
docker run -d -p 5000:5000 --restart=always --name registry registry:2
after which am trying to push the image to local repo
docker tag d3ecb4966f24 X.X.X.X:2376/image
docker push X.X.X.X:2376/image
Error : x509: certificate signed by unknown authority
You got two options:
Bring the registry up with a valid certificate (recommended for production)
Add your registry as insecure in your docker daemons (not recommended for production) :
Dont do this in production, make it secure
Add the following to daemon.json
{
"insecure-registries" : ["X.X.X.X:2376"]
}
Restart docker daemon

docker command not running

I am new to docker and trying to run the following codes and getting the error below.
Nihits-MacBook-Pro:~ nihit$ docker container run --publish 80:80 nginx
Unable to find image 'nginx:latest' locally
latest: Pulling from library/nginx
bc95e04b23c0: Pull complete
110767c6efff: Pull complete
f081e0c4df75: Pull complete
Digest: sha256:004ac1d5e791e705f12a17c80d7bb1e8f7f01aa7dca7deee6e65a03465392072
Status: Downloaded newer image for nginx:latest
docker: Error response from daemon: driver failed programming external connectivity on endpoint gracious_pare (0a28a065694108085e2b7533870d9d84889899baf5d4130c58c49c4736bb6b12): Error starting userland proxy: Bind for 0.0.0.0:80: unexpected error (Failure EADDRINUSE).
ERRO[0016] error waiting for container: context canceled
I tried different codes with port but all of them get stuck and don't do anything.
Nihits-MacBook-Pro:~ nihit$ docker container run --publish 3000:80 nginx
Nihits-MacBook-Pro:~ nihit$ docker container run --publish 8080:80 nginx
None of them work and just are stuck on the terminal.
This should work
docker container run --publish 3000:80 nginx:latest
Since I read the above conversation, it looks like you recieved a long string of number meaning that docker is running, just hit the url localhost:3000 you will see nginx running.
Normally port:80 is used by php if you have apache installed on your computer.
If it gets stuck it also means that the docker is running but not in the background.
Normally the --detach or -d means that the docker will provide you the long string of numbers which tells docker to run the app in the background so you won't see anything happening in the terminal.
Would you mind to try the below command to start the nginx again?
$ docker run -d -p 80:80 nginx:latest
BTW, all commands which start with "docker container" seems the new commands from docker.
But, according to the https://docs.docker.com/edge/engine/reference/commandline/docker/,
the function of "docker container run" should be same as "docker run".
Not sure why difference between those two commands.
In my cases, I'm seldom to use the commands which start with "docker container" to execute my container.
If the container successfully started, the shell will return the message such as follows:
sh-3.2# docker run -d -p 8080:80 nginx:latest
b0a5aa7965119c5b2705392b5b9e9640a4ab8edefda6722ee86da507229cdf05
sh-3.2#
sh-3.2# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED
b0a5aa796511 nginx:latest "nginx -g 'dae... About a minute ago...

Resources