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.

11206 questions
59
votes
1 answer

docker is not VM , why container need base image OS ?

It is said that docker is not a VM and containers directly run on the host. But why do containers need a base image OS ? If process in containers run on the base image OS , what's the difference between a VM and docker(only the base image OS can be…
cola
  • 691
  • 1
  • 6
  • 15
58
votes
5 answers

Multiple Docker containers, same image, different config

I'm totally new to Docker so I appreciate your patience. I'm looking for a way to deploy multiple containers with the same image, however I need to pass in a different config (file) to each? Right now, my understanding is that once you build an…
Ant
  • 796
  • 2
  • 7
  • 13
58
votes
8 answers

How to remove multiple docker images with the same imageID?

I created a local docker registry and then pull some of my docker images from docker hub and then push them to the local registry. Now I want to remove my local images. But the problem here is that imageID of the images are the same and I cannot…
Hadi
  • 5,328
  • 11
  • 46
  • 67
57
votes
3 answers

How to run Nginx docker container with custom config?

I have a Dockerfile and custom Nginx configuration file (in the same directory with Dockerfile) as follows: Dockerfile: FROM nginx COPY nginx.conf /etc/nginx/nginx.conf nginx.conf file: upstream myapp1 { least_conn; server…
Abdurrahman Alp Köken
  • 1,236
  • 1
  • 13
  • 12
55
votes
3 answers

What are Containers/Adapters? C++

What are containers/adapters? I have basic knowledge of C++ and its sub-topics like (class/templates/STL). Can anyone please explain in layman's language and give me a practical example of the application of containers/adapters?
Pavitar
  • 4,282
  • 10
  • 50
  • 82
55
votes
1 answer

Can't use yum inside Docker container running on CentOS

I am unable to run any yum commands inside my Docker container without getting the following error: ovl: Error while doing RPMdb copy-up: [Errno 13] Permission denied: '/var/lib/rpm/Group' You need to be root to perform this command. I'm confused…
NateW
  • 2,856
  • 5
  • 26
  • 46
54
votes
3 answers

Is it possible to cache multi-stage docker builds?

I recently switched to multi-stage docker builds, and it doesn't appear that there's any caching on intermediate builds. I'm not sure if this is a docker limitation, something which just isn't available or whether I'm doing something wrong. I am…
Matthew Goslett
  • 1,127
  • 1
  • 7
  • 6
53
votes
2 answers

Unsupported config option for services.volumes

Trying to setup docker for the first time and I'm running into a problem with volumes. I feel pretty confident that the spacing and formatting in the .yml is correct at this point. I've tried versions 3, 3.1, 3.2, 3.3 and 3.4. All are getting the…
Coy
  • 543
  • 1
  • 4
  • 10
52
votes
2 answers

How can I iterate in reverse over a map in C++?

I'm having trouble iterating in reverse over a map in GCC C++. When I use a reverse iterator, it seems I can't assign anything to it - the compiler complains. I'm working around it with some awkward code using a forward iterator, but it's not very…
Jack BeNimble
  • 35,733
  • 41
  • 130
  • 213
52
votes
4 answers

How do I run curl command from within a Kubernetes pod

I have the following questions: I am logged into a Kubernetes pod using the following command: ./cluster/kubectl.sh exec my-nginx-0onux -c my-nginx -it bash The 'ip addr show' command shows its assigned the ip of the pod. Since pod is a logical…
Mayank
  • 521
  • 1
  • 4
  • 4
52
votes
9 answers

How to get a sub array of array in Java, without copying data?

I have some library of classes, working with my data, which is being read into buffer. Is it possible somehow to avoid copying arrays again and again, passing parts of data deeper and deeper into processing methods? Well, it sounds strange, but in…
Illarion Kovalchuk
  • 5,774
  • 8
  • 42
  • 54
52
votes
7 answers

From within a view controller in a container view, how do you access the view controller containing the container?

This is tricky to word but I have a view controller (vc1) that contains a container view (I'm using storyboards). Within that container view is a navigation controller and a root view controller (vc2). From within the vc2 how can I get access to…
Mark Bridges
  • 8,228
  • 4
  • 50
  • 65
51
votes
4 answers

docker-compose container name use dash (-) instead of underscore (_)

I always used docker-compose on Ubuntu, in this environment containers are named with underscore: __ But now, I switched to Windows 10 (using Docker Desktop) and naming convention has…
jawira
  • 3,668
  • 2
  • 17
  • 27
51
votes
9 answers

How to copy files from local machine to docker container on windows

I have to import data files from a user local file C:/users/saad/bdd to a docker container (cassandra), I didn't find how to proceed using docker commands. I'm working on windows 7.
Manou
  • 511
  • 1
  • 4
  • 3
50
votes
6 answers

Docker interactive mode and executing script

I have a Python script in my docker container that needs to be executed, but I also need to have interactive access to the container once it has been created ( with /bin/bash ). I would like to be able to create my container, have my script executed…
will.fiset
  • 1,524
  • 1
  • 19
  • 29