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

in operator, float("NaN") and np.nan

I used to believe that in operator in Python checks the presence of element in some collection using equality checking ==, so element in some_list is roughly equivalent to any(x == element for x in some_list). For example: True in [1, 2, 3] # True…
Ilya V. Schurov
  • 7,687
  • 2
  • 40
  • 78
37
votes
8 answers

Appending to PATH in a Windows Docker container

I need to append to the PATH within a Windows Docker container, and I've tried many permutations. ENV PATH=%PATH%;C:\\Foo\\bin ENV PATH=$PATH;C:\\Foo\\bin ENV PATH="%PATH%;C:\Foo\bin" ENV PATH="$PATH;C:\Foo\bin" RUN "set…
macetw
  • 1,640
  • 1
  • 17
  • 26
37
votes
2 answers

How to know if a docker container is running in privileged mode

Would like to know via bash script, if current running container was started in --privileged mode from inside the container (not from the host machine). For now I'm stuck with passing an env var with the flag but is not an ideal solution.
Leo Gallucci
  • 16,355
  • 12
  • 77
  • 110
37
votes
9 answers

How can I use an array as map value?

I'm trying to create a map, where the key is an int, and the value is an array as follows: int red[3] = {1,0,0}; int green[3] = {0,1,0}; int blue[3] = {0,0,1}; std::map
Tom
  • 43,810
  • 29
  • 138
  • 169
36
votes
7 answers

Understanding servlet container

As a UI devloper and someone with very limited Java knowledge, how do I understand what exactly is servlet container in simple terms ? I have heard Weblogic, JBoss, etc are servlet containers, but not sure what that means exactly. Does it mean any…
copenndthagen
  • 49,230
  • 102
  • 290
  • 442
36
votes
1 answer

How does Debian differ from Debian-Slim?

I am trying to select a recommended base Linux distribution for my company's container images. I have narrowed it down to Debian and Debian-Slim. Everything I read says that Debian-Slim is just a pared down distribution. But I can't seem to find…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
36
votes
2 answers

How to create WPF usercontrol which contains placeholders for later usage

I'd better ask the question by example. Let's say I have UserControl and Window which uses this control. I would like to design this control (named MyControl) in such way (this is sci-fi syntax!):
greenoldman
  • 16,895
  • 26
  • 119
  • 185
36
votes
3 answers

Ulimits in Docker host vs container

I wasn't able to find straight answer, to this question, but here it is: Let's say that I have a host which has max open files 1024: [root@host]# ulimit -a open files (-n) 1024 and a docker container running in that host…
os11k
  • 1,210
  • 2
  • 13
  • 26
36
votes
2 answers

What is the purpose of std::scoped_allocator_adaptor?

In the C++11 standard we have std::scoped_allocator_adaptor in the dynamic memory management library. What are the most important use cases of this class?
Ralph Tandetzky
  • 22,780
  • 11
  • 73
  • 120
35
votes
4 answers

c++ template class; function with arbitrary container type, how to define it?

Okay, simple template question. Say I define my template class something like this: template class foo { public: foo(T const& first, T const& second) : first(first), second(second) {} template void bar(C&…
Fault
  • 1,239
  • 4
  • 14
  • 18
35
votes
2 answers

How to install git on a docker ubuntu image?

I have a simple docker file of FROM ubuntu:18.04 COPY . /usr/src/app/ COPY docker_files/.bash_aliases /root/ $ docker build -t dock . Sending build context to Docker daemon 146.9kB Step 1/3 : FROM ubuntu:18.04 ---> 94e814e2efa8 Step 2/3 : COPY .…
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
35
votes
11 answers

When do you prefer using std::list instead of std::vector?

I've never used std::list myself. I was wondering when people use it when we already have std::vector which is just like arrays with contiguous memory. std::vector seems like a perfect choice when we need sequential container! So my question…
Nawaz
  • 353,942
  • 115
  • 666
  • 851
35
votes
4 answers

Start service using systemctl inside docker container

In my Dockerfile I am trying to install multiple services and want to have them all start up automatically when I launch the container. One among the services is mysql and when I launch the container I don't see the mysql service starting up. When…
Premchand
  • 709
  • 2
  • 7
  • 13
35
votes
5 answers

How do I mount a Docker volume while using a Windows host?

Mounting a Docker volume while being under a Windows host, has been a huge pain for me, and I could not get it to work. Currently I got the following simple Dockerfile: FROM php:5-apache RUN apt-get update When I build an image from it, and start a…
Philipp Schaffrath
  • 353
  • 1
  • 3
  • 6
34
votes
4 answers

Delete all the contents from a kubernetes node

How to delete all the contents from a kubernetes node? Contents include deployments, replica sets etc. I tried to delete deplyoments seperately. But kubernetes recreates all the pods again. Is there there any ways to delete all the replica sets…
Mufeed
  • 3,018
  • 4
  • 20
  • 29