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
20
votes
9 answers

Recommend C++ container to hold top 20 minimum values

In SQL there is the feature to say something like SELECT TOP 20 distance FROM dbFile ORDER BY distance ASC If my SQL is correct with, say 10,000 records, this should return the 20 smallest distances in my databse. I don't have a database. I have a…
kingchris
  • 1,677
  • 22
  • 29
20
votes
1 answer

Is docker a solution for making application cross platform?

I'm getting started with docker by reading some blogs and introduction material. My understanding is docker can wrap a single application into a standardized container. The container provides a sandbox, all the necessary resources the application…
Aaron Shen
  • 8,124
  • 10
  • 44
  • 86
20
votes
2 answers

Bind a directory to a docker container

I'm building a test project that requires a module outside of the project directory. The project folder is in docker, and I would like to bind that module directory to the docker container of my project. Is it even possible to do it? Or am I asking…
avian
  • 343
  • 1
  • 2
  • 10
20
votes
2 answers

Docker Rails app fails to be served - curl: (56) Recv failure: Connection reset by peer

I build a Rails app container with the following Dockerfile: $ cat Dockerfile FROM ruby:2.2 MAINTAINER Luca G. Soave RUN apt-get update && apt-get install -y nodejs --no-install-recommends && rm -rf /var/lib/apt/lists/* RUN…
Luca G. Soave
  • 12,271
  • 12
  • 58
  • 109
20
votes
3 answers

Why is 'unbounded_array' more efficient than 'vector'?

It says here that The unbounded array is similar to a std::vector in that in can grow in size beyond any fixed bound. However unbounded_array is aimed at optimal performance. Therefore unbounded_array does not model a Sequence like …
Neil G
  • 32,138
  • 39
  • 156
  • 257
19
votes
4 answers

STL algorithms taking the whole container rather than .begin(), end() as arg?

Stand-alone STL algorithms (like std::count_if) take pair of iterators. In all cases where I use those (and in all examples I've seen online!), I find myself typing std::count_if(myContainer.begin(),myContainer.end(), /* ... */ ); Is there a reason…
eudoxos
  • 18,545
  • 10
  • 61
  • 110
19
votes
2 answers

Container Fails to Start: Insufficient memory for the Java Runtime Environment to continue

We have an enterprise application running on Java 8. The deployment environment is built & updated through Bitbucket pipelines. I have a graphic showing the high-level architecture of the environment. We have two app servers running identical…
Master.Aurora
  • 908
  • 2
  • 11
  • 26
19
votes
6 answers

How to make GCE instance stop when its deployed container finishes?

I have a Docker container that performs a single large computation. This computation requires lots of memory and takes about 12 hours to run. I can create a Google Compute Engine VM of the appropriate size and use the "Deploy a container image to…
Adam
  • 16,808
  • 7
  • 52
  • 98
19
votes
5 answers

Running a command on all kubernetes pods of a service

Hey I'm running a kubernetes cluster and I want to run a command on all pods that belong to a specific service. As far as I know kubectl exec can only run on a pod and tracking all my pods is a ridiculous amount of work (which is one of the benefits…
Yonah Dissen
  • 1,197
  • 1
  • 8
  • 16
19
votes
2 answers

What causes transport: "dial unix /var/run/docker/containerd/docker-containerd.sock: connect: connection refused"?

There are good explanations on how to resolve this issue. SOF Q1, SOF Q2 and many more related questions on SOF and internet. My worry is, what causes this issue and why docker ends up in this state. (/var/run contains run time data of an…
user8339674
19
votes
2 answers

run container as root user

Is there any way I can run container in k8s as root user or other user. Like in docker docker run --user Is there any yaml configuration for running with
Itay Gil
  • 221
  • 1
  • 2
  • 5
19
votes
2 answers

Difference between container port,host port and service port in dcos json in portMappings

I am confused with what all these port signify container port,host port and service port in portMappings, below is my json "portMappings": [ { "containerPort": 9000, "hostPort": 9000, "labels": { "VIP_0": "/app2n:9000" }, …
Kuldeep Dangi
  • 4,126
  • 5
  • 33
  • 56
19
votes
1 answer

Why do sequential containers have both size_type and difference_type?

vector has both vector::size_type and vector::difference_type. It seems unnecessary for both to exist since size_type is guaranteed to be able to hold a value as large as the maximum number of elements that a vector may contain…
Teddy
  • 301
  • 1
  • 6
19
votes
1 answer

What environment variables are created in kubernetes by default

I can't find this in the k8s documentation, I'm just wondering what are the default environment variables that are created in every container by k8s. Not user created defaults, but like (and this is just an example) maybe something like…
Luis F Hernandez
  • 891
  • 2
  • 14
  • 29
19
votes
7 answers

How can I keep docker container running?

I want to run multiple containers automatically and create something, but some images, such as swarm, will automatically stop after run or start. I already try like that docker run -d swarm docker run -d swarm /bin/bash tail -f /dev/null docker…
haeny
  • 363
  • 2
  • 5
  • 15