Questions tagged [containers]

A container is a class, a data structure, or an abstract data type whose instances are collections of other objects. Containers typically make use of generics or templates so that a wide variety of objects can be added.

Containers are available in most programming languages, allowing programmers to store, transfer, and read back data within a program. Common containers include arrays, lists, queues, stacks, sets, and maps, each providing different levels of efficiency for tasks such as adding or removing elements, searching for elements, or iterating through elements.

8850 questions
3957
votes
21 answers

How is Docker different from a virtual machine?

I keep rereading the Docker documentation to try to understand the difference between Docker and a full VM. How does it manage to provide a full filesystem, isolated networking environment, etc. without being as heavy? Why is deploying software to a…
zslayton
  • 45,810
  • 9
  • 33
  • 48
391
votes
14 answers

docker: "build" requires 1 argument. See 'docker build --help'

Trying to follow the instructions for building a docker image from the docker website. https://docs.docker.com/examples/running_redis_service/ this is the error I get will following the instructions on the doc and using this Dockerfile FROM …
Tampa
  • 62,379
  • 105
  • 250
  • 388
363
votes
21 answers

How to run a cron job inside a docker container?

I am trying to run a cronjob inside a docker container that invokes a shell script. Yesterday I have been searching all over the web and stack overflow, but I could not really find a solution that works. How can I do this? EDIT: I've created a…
C Heyer
  • 3,633
  • 3
  • 8
  • 6
306
votes
7 answers

What's the difference between ClusterIP, NodePort and LoadBalancer service types in Kubernetes?

1 - I'm reading the documentation and I'm slightly confused with the wording. It says: ClusterIP: Exposes the service on a cluster-internal IP. Choosing this value makes the service only reachable from within the cluster. This is the default…
AmazingBergkamp
  • 3,502
  • 4
  • 12
  • 18
250
votes
27 answers

Why use iterators instead of array indices?

Take the following two lines of code: for (int i = 0; i < some_vector.size(); i++) { //do stuff } And this: for (some_iterator = some_vector.begin(); some_iterator != some_vector.end(); some_iterator++) { //do stuff } I'm told that the…
Jason Baker
  • 171,942
  • 122
  • 354
  • 501
219
votes
3 answers

List only stopped Docker containers

Docker gives you a way of listing running containers or all containers including stopped ones. This can be done by: $ docker ps # To list running containers Or by $ docker ps -a # To list running and stopped containers Do we have a way of only…
Yogesh_D
  • 14,022
  • 8
  • 31
  • 47
203
votes
4 answers

Starting a shell in the Docker Alpine container

To start an interactive shell for the Ubuntu image we can run: ole@T:~$ docker run -it --rm ubuntu root@1a6721e1fb64:/# ls bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var But when this is run…
Ole
  • 29,797
  • 32
  • 110
  • 232
203
votes
10 answers

Docker error cannot delete docker container, conflict: unable to remove repository reference

I want to remove the container at Docker, but an error occurs when you want to delete My next step before removing the container, see the list of existing container sts@Yudi:~/docker$ sudo docker ps -as CONTAINER ID IMAGE …
Yuday
  • 3,391
  • 2
  • 14
  • 20
167
votes
3 answers

What are the complexity guarantees of the standard containers?

Apparently ;-) the standard containers provide some form of guarantees. What type of guarantees and what exactly are the differences between the different types of container? Working from the SGI page (about STL) I have come up with this: Container…
Martin York
  • 234,851
  • 74
  • 306
  • 532
161
votes
13 answers

How can I keep a container running on Kubernetes?

I'm now trying to run a simple container with shell (/bin/bash) on a Kubernetes cluster. I thought that there was a way to keep a container running on a Docker container by using pseudo-tty and detach option (-td option on docker run command). For…
springwell
  • 1,721
  • 2
  • 9
  • 6
145
votes
12 answers

How to get the list of dependent child images in Docker?

I'm trying to remove an image and I get: # docker rmi f50f9524513f Failed to remove image (f50f9524513f): Error response from daemon: conflict: unable to delete f50f9524513f (cannot be forced) - image has dependent child images This is the docker…
nicocesar
  • 2,214
  • 2
  • 15
  • 24
134
votes
8 answers

How do I ssh into the VM for Minikube?

What is the username/password/keys to ssh into the Minikube VM?
soupybionics
  • 3,510
  • 3
  • 23
  • 38
127
votes
3 answers

How to know the reason why a docker container exits?

I have a Docker container running in a host of 1G RAM (there are also other containers running in the same host). The application in this Docker container will decode some images, which may consume memory a lot. From time to time, this container…
Li Bin
  • 1,371
  • 3
  • 9
  • 12
118
votes
10 answers

What's the best way to iterate over two or more containers simultaneously

C++11 provides multiple ways to iterate over containers. For example: Range-based loop for(auto c : container) fun(c) std::for_each for_each(container.begin(),container.end(),fun) However what is the recommended way to iterate over two (or more)…
memecs
  • 5,816
  • 6
  • 30
  • 46
112
votes
6 answers

Why isn't vector a STL container?

Item 18 of Scott Meyers's book Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library says to avoid vector as it's not an STL container and it doesn't really hold bools. The following code: vector v; bool…
P0W
  • 42,046
  • 8
  • 62
  • 107
1
2 3
99 100