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
50
votes
2 answers

Abstract factory pattern on top of IoC?

I have decided to use IoC principles on a bigger project. However, i would like to get something straight that's been bothering me for a long time. The conclusion that i have come up with is that an IoC container is an architectural pattern, not a…
Sergey
50
votes
6 answers

Java EE Containers vs Web Containers

I'm relatively new to Java EE/EJB, and I've been reading a lot regarding Java EE containers. I've had experience working with a web container (WAR file in JBoss). I am also aware that JBoss can also be used as a Java EE container. What is the…
mel3kings
  • 8,857
  • 3
  • 60
  • 68
49
votes
6 answers

Expand container div with content width

I have the following structure in my application:
...
Each child div has a known fixed…
Andre
  • 645
  • 1
  • 6
  • 6
49
votes
11 answers

Flutter how to handle image with fixed size inside box?

I am new to Flutter and I like it but I am not comfortable building layouts. I am working on an app that contains a ListView of Cards. Each card is inside a Container and contains an image (with fixed height and width) and a text. I am not able to…
Francesco Romano
  • 579
  • 1
  • 4
  • 12
49
votes
2 answers

How does the Docker assign MAC addresses to containers?

When I start new containers, Docker automatically assigns some MAC address to them. I am curious if there is a pattern to this assignment. Can the MAC address be changed? $ docker network inspect bridge "Containers": { …
monica
  • 653
  • 1
  • 6
  • 12
49
votes
1 answer

Why does Docker need a Union File System

What exactly does Docker do with Union File system (like AUFS) to create the containers ? If Docker had to use a regular file system instead of a union file system what will be the disadvantages ? I am looking for specific technical…
Manohar
  • 3,865
  • 11
  • 41
  • 56
48
votes
10 answers

ItemContainerGenerator.ContainerFromItem() returns null?

I'm having a bit of weird behavior that I can't seem to work out. When I iterate through the items in my ListBox.ItemsSource property, I can't seem to get the container? I'm expecting to see a ListBoxItem returned, but I only get null. Any…
Sonny Boy
  • 7,848
  • 18
  • 76
  • 104
46
votes
2 answers

mutable vs. immutable in Scala collections

I am fairly new to Scala and am trying to understand the collections hierarchy. I see that there is a distinction between 'mutable' and 'immutable' collections, but I don't understand what this actually means at the implementation level and how…
astay13
  • 6,857
  • 10
  • 41
  • 56
46
votes
3 answers

docker restart container failed: "already in use", but there's no more docker image

I first got my nginx docker image: docker pull nginx Then I started it: docker run -d -p 80:80 --name webserver nginx Then I stopped it: docker stop webserver Then I tried to restart it: $docker run -d -p 80:80 --name webserver nginx docker:…
Hind Forsum
  • 9,717
  • 13
  • 63
  • 119
46
votes
2 answers

Docker RabbitMQ persistency

RabbitMQ in docker lost data after remove container without volume. My Dockerfile: FROM rabbitmq:3-management ENV RABBITMQ_HIPE_COMPILE 1 ENV RABBITMQ_ERLANG_COOKIE "123456" ENV RABBITMQ_DEFAULT_VHOST "123456" My run…
Rinat Mukhamedgaliev
  • 5,401
  • 8
  • 41
  • 59
45
votes
4 answers

How many containers should exist per host in production? How should services be split?

I'm trying to understand the benefits of Docker better and I am not really understanding how it would work in production. Let's say I have a web frontend, a rest api backend and a db. That makes 3 containers. Let's say that I want 3 of the front…
Terence Chow
  • 10,755
  • 24
  • 78
  • 141
45
votes
4 answers

Copy folder with wildcard from docker container to host

Creating a backup script to dump mongodb inside a container, I need to copy the folder outside the container, Docker cp doesn't seem to work with wildcards : docker cp mongodb:mongo_dump_* . The following is thrown in the terminal : Error…
Abdelrahman Elkady
  • 2,518
  • 2
  • 21
  • 30
45
votes
9 answers

Check if in "dev" mode inside a Controller with Symfony

When using dev mode with a Symfony2.x application, one usually works in locale. Hence, such function does not works as expected (for instance, try to get the current IP under localhost). This could be a problem, e.g. when one try to use such…
JeanValjean
  • 17,172
  • 23
  • 113
  • 157
44
votes
2 answers

What is the difference between “container_memory_working_set_bytes” and “container_memory_rss” metric on the container

I need to monitor my container memory usage running on kubernetes cluster. After read some articles there're two recommendations: "container_memory_rss", "container_memory_working_set_bytes" The definitions of both metrics are said (from the…
zeroFruit
  • 712
  • 1
  • 8
  • 18
43
votes
3 answers

Add bind mount to Dockerfile just like volume

I want to add the bind mount to docker file just like I initialise a volume inside Dockefile. Is there any way for it?
Mufeed
  • 3,018
  • 4
  • 20
  • 29