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

Copying files with execute permissions in Docker Image

Seems like a basic issue but couldnt find any answers so far .. When using ADD / COPY in Dockerfile and running the image on linux, the default file permission of the file copied in the image is 644. The onwner of this file seems to be as 'root'…
22
votes
8 answers

Docker: npm not found

I have the following Dockerfile: FROM ubuntu USER root RUN apt-get update && apt-get install curl -y RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - RUN apt-get update && apt-get upgrade -y && apt-get install nodejs -y RUN mkdir…
Sohrab
  • 1,348
  • 4
  • 13
  • 33
22
votes
6 answers

Python equivalent for C++ STL vector/list containers

Is there something similar in Python that I would use for a container that's like a vector and a list? Any links would be helpful too.
pandoragami
  • 5,387
  • 15
  • 68
  • 116
22
votes
9 answers

How do I list all containers in a user-defined docker network?

How do I get a list of all the containers in a user-defined docker network? I would like to get all the commit hashes of every container for a specific user-defined docker network.
Viktor Vojnovski
  • 1,191
  • 1
  • 7
  • 19
22
votes
4 answers

Unable to ssh localhost within a running Docker container

I'm building a Docker image for an application which requires to ssh into localhost (i.e ssh user@localhost) I'm working on a Ubuntu desktop machine and started with a basic ubuntu:16.04 container. Following is the content of my Dockerfile: FROM…
Akshay
  • 452
  • 1
  • 5
  • 15
22
votes
1 answer

docker-compose: redis connection refused between containers

I am trying to setup a docker-compose file that is intended to replace a single Docker container solution that runs several processes (RQ worker, RQ dashboard and a Flask application) with Supervisor. The host system is a Debian 8 Linux and my…
henning82
  • 223
  • 1
  • 2
  • 6
22
votes
2 answers

How to expose audio from Docker container to a Mac?

I know it's possible by using pulse audio on a Linux host system But paprefs is built for linux not mac.
benwiz
  • 2,167
  • 3
  • 22
  • 33
22
votes
1 answer

Windows 10 Docker Host - Display GUI application from Linux Container

I'm trying to use Windows 10 as my host and run Docker containers that contain gui based applications and display them using X11 forwarding or something similar. Pretty much all of the information I've found online deal with Linux Host to Linux…
Fitz
  • 243
  • 1
  • 2
  • 7
22
votes
4 answers

How do I forward a docker-machine port to my host port on OSX?

I’m delivering a private docker container in my company and want my colleagues to be able to access in our internal network, the problem is that my guest OS is OSX and as so I can only access my application using the 192.168.99.100:3000 default ip…
Juliano Pacheco
  • 521
  • 1
  • 5
  • 13
22
votes
2 answers

When to use C++ forward_list

I am kind of new to C++, and reading the book "The C++ Programming Language (4th edition)". When reading chapter of "STL Containers", the book has a introduction to forward_list: A forward_list (a singly-linked list) is basically a list optimized …
user2558887
22
votes
5 answers

Why is std::vector contiguous?

Besides the fact that the standard defines it to be contiguous, why is std::vector contiguous? If it runs out of space, it needs to reallocate a new block and copy the old block to the new one before continuing. What if it wasn't contiguous? When…
deller
  • 490
  • 3
  • 12
22
votes
5 answers

Is there a safe alternative to std::equal?

std::equal() is unsafe because the function cannot know whether it will overrun the length of the second container to be compared. That is: std::vector< int > v( 100 ); std::vector< int > w( 10 ); bool same = std::equal( v.begin(), v.end(),…
OldPeculier
  • 11,049
  • 13
  • 50
  • 76
22
votes
4 answers

limit size of Queue in C++

I notice the thread of similar question: Limit size of Queue in .NET? That's exactly what I want to do, but I am not using .net but GNU C++. I have no reference to the base class in GNU C++, so java like super.***() or .net like base.***() will…
Lily
  • 5,872
  • 19
  • 56
  • 75
21
votes
1 answer

Docker view the logs of failed / crashed container

I know you can check the logs of a running container with: Command to list containers docker container ls Command to view the logs docker logs [container-id] Question: Can you also check the logs of a failed container that is not listed, because the…
Bram Janssen
  • 1,057
  • 1
  • 9
  • 14
21
votes
1 answer

what is the purpose of conda inside a container?

I have seen many examples of dockerfiles with conda commands in them. And there are pre-build anaconda and miniconda containers. I must be missing something. Doesn't docker REPLACE virtualenv and conda? Shouldn't I have all of my dependencies right…
red888
  • 27,709
  • 55
  • 204
  • 392