containers

How to get IP address of running docker container

荒凉一梦 提交于 2019-12-02 16:08:58
I am using Docker for Mac. I am running a nodejs based microservice in a Docker container. I want to test node microservice through the browser. How to get IP address of running docker container? If you don't want to map ports from your host to the container you can access directly to the docker range ip for the container. This range is by default only accessed from your host. You can check your container network data doing: docker inspect <containerNameOrId> Probably is better to filter: docker inspect <containerNameOrId> | grep '"IPAddress"' | head -n 1 Usually, the default docker ip range

Is it possible to install Visual Studio in a Windows Container

自古美人都是妖i 提交于 2019-12-02 15:43:18
Is it possible to install any version of Visual Studio in a Windows Container on a Windows Server? The motivation is to use Windows Containers for building software in continuous integration systems, so that the build environment is standardized. Visual Studio seems to not be supported officially on Core Server, but I agree it would be really nice to be able to do this. Let's try: FROM mcr.microsoft.com/windows/servercore:ltsc2019 SHELL ["powershell"] RUN Invoke-WebRequest "https://aka.ms/vs/15/release/vs_community.exe" -OutFile "$env:TEMP\vs_community.exe" -UseBasicParsing RUN & "$env:TEMP\vs

Container-VM Image with GPD Volumes fails with “Failed to get GCE Cloud Provider. plugin.host.GetCloudProvider returned <nil> instead”

这一生的挚爱 提交于 2019-12-02 14:43:16
问题 I currently try to switch from the "Container-Optimized Google Compute Engine Images" (https://cloud.google.com/compute/docs/containers/container_vms) to the "Container-VM" Image (https://cloud.google.com/compute/docs/containers/vm-image/#overview). In my containers.yaml, I define a volume and a container using the volume. apiVersion: v1 kind: Pod metadata: name: workhorse spec: containers: - name: postgres image: postgres:9.5 imagePullPolicy: Always volumeMounts: - name: postgres-storage

How do I ssh into the VM for Minikube?

允我心安 提交于 2019-12-02 14:34:29
What is the username/password/keys to ssh into the Minikube VM? bfallik You can use the Minikube binary for this, minikube ssh . Mukarram Syed Minikube uses boot2docker as its base image, so the default SSH login to the VM ends up being docker:tcuser 1 . Bob Van Zant I too wanted to login without the Minikube command. I found that it drops the SSH key it generates into ~/.minikube/machines//id_rsa. My machine was named the default "minikube", and therefore I could do: ssh -i ~/.minikube/machines/minikube/id_rsa docker@$(minikube ip) For windows hyper-v the answer was open "Hyper-V Manager"

vector string push_back is not working in c++

半腔热情 提交于 2019-12-02 14:32:29
问题 This code snippet receives string, delimiter(space) and vector as argument and splits the string according to delimiter and stores it in vector. It is not storing anything into vector if i use push_back but works if i use [] operator. Can someone explain why push_back is not working? void split(const string & input,char delim,vector<string> & elems){ stringstream ss; ss.str(input); string item; int i = 0; while(getline(ss,item,delim)){ //elems.push_back(item); elems[i] = item; i++; } } int

set environment variable in running docker contianer

☆樱花仙子☆ 提交于 2019-12-02 14:30:55
问题 I need to set environment variable in a running docker container. I am already aware of the way of setting environment variable while creating a container. As far I found there is no available straight forward way to do this with docker and docker is planning to add something with new version 1.13. But I found that some people able to manage it which is not working for me now. I tried following ways but did not work for me- docker exec -it -u=root test /bin/bash -c "export port=8090" echo

List only stopped Docker containers

ε祈祈猫儿з 提交于 2019-12-02 14:11:13
Docker gives you a way of listing running containers or all containers including stopped ones. This can be done by: $ docker ps # To list running containers Or by $ docker ps -a # To list running and stopped containers Do we have a way of only listing containers that have been stopped? Only stopped containers can be listed using: docker ps --filter "status=exited" or docker ps -f "status=exited" The typical command is: docker container ls -f 'status=exited' However, this will only list one of the possible non-running statuses. Here's a list of all possible statuses: created restarting running

Starting a shell in the Docker Alpine container

ⅰ亾dé卋堺 提交于 2019-12-02 14:02:21
To start an interactive shell for the Ubuntu image we can run: ole@T:~$ docker run -it --rm ubuntu root@1a6721e1fb64:/# ls bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var But when this is run for the Alpine Docker image , the following results: ole@T:~$ docker run -it --rm alpine Error response from daemon: No command specified What is the command for starting an interactive shell in an Alpine base container? Ole ole@T:~$ docker run -it --rm alpine /bin/ash (inside container) / # Options used above: /bin/ash is Ash ( Almquist Shell ) provided by BusyBox -

Storing multiple types of a templated class into a container

你说的曾经没有我的故事 提交于 2019-12-02 13:35:02
问题 If I have a class with a template: template<typename T> class foo{ T m_a; foo(T a){ m_a = a; }; ~foo(){ }; }; Is there a way to store multiple variation of it ? For example a vector that can store a pointer to foo< int > and foo< string > at the same time ? Edit more info I want to hide the implementation of this : EventListener<string> ev1; EventListener<int, int> ev2; EventListener<int, string, double> ev3; ev1(&Events::nameChange, &nameChangeCallback); ev2(&Events::healthChange,

std::map<int, int> vs. vector of vector

喜夏-厌秋 提交于 2019-12-02 11:39:05
I need a container to store a value (int) according to two attributes, source (int) and destination (int) i.e. when a source sends something to a destination, I need to store it as an element in a container. The source is identified by a unique int ID (an integer from 0-M), where M is in the tens to hundreds, and so is the destination (0-N). The container will be updated by iterations of another function. I have been using a vector(vector(int)) which means goes in the order of source(destination(value)). A subsequent process needs to check this container, to see if an element exists in for a