containers
Starting a shell in the Docker Alpine container
ole@T:~$ docker run -it –rm alpine /bin/ash (inside container) / # Options used above: /bin/ash is Ash (Almquist Shell) provided by BusyBox –rm Automatically remove the container when it exits (docker run –help) -i Interactive mode (Keep STDIN open even if not attached) -t Allocate a pseudo-TTY
Docker error cannot delete docker container, conflict: unable to remove repository reference
There is a difference between docker images and docker containers. Check this SO Question. In short, a container is a runnable instance of an image. which is why you cannot delete an image if there is a running container from that image. You just need to delete the container first. docker ps -a # Lists … Read more
List only stopped Docker containers
Only stopped containers can be listed using: docker ps –filter “status=exited” or docker ps -f “status=exited”
Why use iterators instead of array indices?
The first form is efficient only if vector.size() is a fast operation. This is true for vectors, but not for lists, for example. Also, what are you planning to do within the body of the loop? If you plan on accessing the elements as in T elem = some_vector[i]; then you’re making the assumption that … Read more
What’s the difference between ClusterIP, NodePort and LoadBalancer service types in Kubernetes?
[*] A ClusterIP exposes the following: spec.clusterIp:spec.ports[*].port You can only access this service while inside the cluster. It is accessible from its spec.clusterIp port. If a spec.ports[*].targetPort is set it will route from the port to the targetPort. The CLUSTER-IP you get when calling kubectl get services is the IP assigned to this service within … Read more
How to run a cron job inside a docker container?
You can copy your crontab into an image, in order for the container launched from said image to run the job. See “Run a cron job with Docker” from Julien Boulay in his Ekito/docker-cron: Let’s create a new file called “hello-cron” to describe our job. # must be ended with a new line “LF” (Unix) … Read more