containers

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

心不动则不痛 提交于 2019-12-03 06:19:00
问题 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: Error response from daemon: Conflict. The container name "/webserver" is already in use by container 036a0bcd196c5b23431dcd9876cac62082063bf62a492145dd8a55141f4dfd74. You have to remove (or rename) that container to be able to reuse that name.. See

How do I create a docker machine with a specific URL using docker-machine and VirtualBox?

六眼飞鱼酱① 提交于 2019-12-03 06:15:50
I can create a Docker instance with the VirtualBox driver, but I cannot figure out how to specify the URL. Create Command: docker-machine create --driver virtualbox myBox docker-machine ls: NAME ACTIVE DRIVER STATE URL SWARM myBox * virtualbox Running tcp://192.168.99.100:2376 I want the URL to be a specific URL. How can I force the Docker instance to use a specific URL (ex: 192.168.99.113)? Details: Mac 10.10.5 using Docker Toolbox Update I tried using the --virtualbox-hostonly-cidr command to set the IP range for the docker machine; I specified a range of one IP address ("192.168.99.113/32")

In iOS, using storyboard, how to setup a view controller inside a container view?

主宰稳场 提交于 2019-12-03 06:00:07
I have created and drawn out a custom UIViewController called AutocompleteVC in my Main storyboard. AutocompleteVC will be used in several different places/storyboards and with different dimensions. For example, in my Transit storyboard, shown below,, there is a custom UIViewController called TransitVC, shown on the left. In TransitVC, I have a container view with an IBOutlet called autocompleteContainerView. autocompleteContainerView has a segue called autocompleteEmbedSegue to a generic UIViewController, shown on the right in red. The goal is to have TransitVC hold AutocompleteVC inside

How to generate a Postgresql Dump from a Docker container?

蹲街弑〆低调 提交于 2019-12-03 05:42:07
问题 I would like to have a way to enter into the Postgresql container and get a data dump from it. 回答1: Use the following command from a UNIX terminal: docker exec <container_name> pg_dump <schema_name> > backup The following command will dump only inserts from all tables: docker exec <container_name> pg_dump --column-inserts --data-only <schema_name> > inserts.sql 回答2: I have container named postgres with mounted volume -v /backups:/backups To backup gziped DB my_db I use: docker exec postgres

List directories in Windows Azure Blob storage container

匆匆过客 提交于 2019-12-03 05:22:41
I have a question about my project... I need to know how to list all folders (in a string list or something) from a Windows Azure blob storage... I allready have my BlobClient and the connection to my Azure storage. Who can help me with this "problem"? Try this code. It makes use of Storage Client library 2.0.3 : CloudStorageAccount storageAccount = CloudStorageAccount.DevelopmentStorageAccount; CloudBlobContainer blobContainer = storageAccount.CreateCloudBlobClient().GetContainerReference("wad-control-container"); string blobPrefix = null; bool useFlatBlobListing = false; var blobs =

How do i run curl command from within a Kubernetes pod

我与影子孤独终老i 提交于 2019-12-03 05:12:37
I have the following questions:- 1: I am logged into a Kubernetes pod using the following command:- ./cluster/kubectl.sh exec my-nginx-0onux -c my-nginx -it bash the 'ip addr show' command shows its assigned the ip of the pod. Since pod is a logical concept , i am assuming i am logged into a docker container and not a pod, In which case, the pod ip is same as docker container ip. Is that understanding correct ? 2: from a Kubernetes node, i do sudo docker ps and then do the following:- sudo docker exec 71721cb14283 -it '/bin/bash' This doesnt work. Does someone know what i am doing wrong ? 3: i

Caching the end iterator - Good idea or Bad Idea?

断了今生、忘了曾经 提交于 2019-12-03 05:08:34
Generally speaking is it a good idea to cache an end iterator (specifically STL containers) for efficiency and speed purposes? such as in the following bit of code: std::vector<int> vint; const std::vector<int>::const_iterator end = vint.end(); std::vector<int>::iterator it = vint.begin(); while (it != end) { .... ++it; } Under what conditions would the end value be invalidated? would erasing from the container cause end to be invalidated in all STL containers or just some? In the simple case of a vector , the end iterator will change when you add or remove elements from the container; though,

How does the Docker assign MAC addresses to containers?

走远了吗. 提交于 2019-12-03 04:52:09
问题 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": { "3386a527aa08b37ea9232cbcace2d2458d49f44bb05a6b775fba7ddd40d8f92c": { "EndpointID": "647c12443e91faf0fd508b6edfe59c30b642abb60dfab890b4bdccee38750bc1", "MacAddress": "02:42:ac:11:00:02", "IPv4Address": "172.17.0.2/16", "IPv6Address": "" },

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

元气小坏坏 提交于 2019-12-03 04:24:48
问题 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 from docker machine. How can I forward the docker-machine 3000 port to my host 80 port? 回答1: At this time Docker Machine is a virtual machine running under VirtualBox in your machine, so to expose your application port you need to map your virtual

Safe parallel read-only access to a STL container

北战南征 提交于 2019-12-03 04:19:07
问题 I want access a STL based container read-only from parallel running threads. Without using any user implemented locking. The base of the following code is C++11 with a proper implementation of the standard. http://gcc.gnu.org/onlinedocs/libstdc++/manual/using_concurrency.html http://www.sgi.com/tech/stl/thread_safety.html http://www.hpl.hp.com/personal/Hans_Boehm/c++mm/threadsintro.html http://www.open-std.org/jtc1/sc22/wg21/ (current draft or N3337, which is essentially C++11 with minor