containers

Insert in unordered map calls constructor

无人久伴 提交于 2021-01-28 02:52:45
问题 In order to avoid duplication of elements, I'm building a class that holds elements and provide an acces to them. My elements ( DynLibrary ) are movable but not copyable class DynLibrary { public: DynLibrary() : _handle(nullptr) {} DynLibrary(const std::string& path) { DynLibrary::open(path); } DynLibrary(const DynLibrary&) = delete; DynLibrary(DynLibrary&&) = default; ~DynLibrary() { DynLibrary::close(); } ... } Those object are allocated in an unordered_map which key is the path that

What if size argument for std::vector::resize is equal to the current size?

限于喜欢 提交于 2021-01-28 01:59:36
问题 Reading the manual about vector::resize http://www.cplusplus.com/reference/vector/vector/resize/ It only says what happens if the size is greater or smaller, but does not say what happens if it's equal. Is it guaranteed that on equal size it will not reallocate the array and invalidate the iterators? I wanted to avoid one branch and handle only 2 cases (>= or <) instead of 3 (< or > or ==), but if resizing to same size is undefined, then i will have to check that case too. 回答1: This is

How to start stop azure container instance using Powershell command or ARM command

≡放荡痞女 提交于 2021-01-27 12:13:59
问题 I know you can start / stop container instance from Azure CLI using below command az container stop --name mycontainer --resource-group myResourceGroupVM but since in my org azure cli gives "Access is denied" error i want to know how to do same using powershell or ARM. I am unable to get any powershell cmdlet to start or stop conrainer instance from documentation. Please help. I referred below documentation for same: https://docs.microsoft.com/en-us/powershell/module/azurerm.containerinstance

Docker container published ports not accessible?

≡放荡痞女 提交于 2021-01-27 07:05:49
问题 So here is the situation, I have a container running built with this dockerfile: FROM python:2-onbuild EXPOSE 8888 CMD [ "nohup", "mock-server", "--dir=/usr/src/app", "&" ] I run it with this command: docker build -t mock_server . docker run -d -p 8888:8888 --name mocky mock_server I am using it on a mac so boot2docker is going and I hit it from the boot2docker ip on 8888. I tried boot2docker ssh and hitting the container from there. I ran docker exec -it mocky bash and ps aux shows: USER PID

Docker Named Volume with targeting windows local folder

爷,独闯天下 提交于 2021-01-27 07:04:16
问题 In docker-compose file I want to create a named volume which will target local drive for test purposes. For production we will use NFS. I created the compose file as following, version: '3.3' services: test: build: . volumes: - type: volume source: data_volume target: /data networks: - network volumes: data_volume: driver: local driver_opts: o: bind type: none device: c:/data networks: network: driver: overlay attachable: true When I run the docker-compose up, I got the following error, for

docker no space left on device macOS

倖福魔咒の 提交于 2021-01-20 15:37:04
问题 I am trying to build a docker image that requires copying some large files (~75GB) and I'm getting the following error when I run the following: $ docker build -t my-project . Step 8/10 : COPY some-large-directory failed to copy files: failed to copy directory: Error processing tar file(exit status 1): write /directory: no space left on device I think the error is caused by the container running out of space (I already increased the docker disk image size to 160GB using docker preferences).

docker no space left on device macOS

落爺英雄遲暮 提交于 2021-01-20 15:36:22
问题 I am trying to build a docker image that requires copying some large files (~75GB) and I'm getting the following error when I run the following: $ docker build -t my-project . Step 8/10 : COPY some-large-directory failed to copy files: failed to copy directory: Error processing tar file(exit status 1): write /directory: no space left on device I think the error is caused by the container running out of space (I already increased the docker disk image size to 160GB using docker preferences).

Migrate Drupal Local Environment to Docker/Container

安稳与你 提交于 2021-01-07 01:00:22
问题 Background I currently have a site that is built using gitlab, composer, vagrant (Drupal-VM) and virtual box, along with other tools like drush, blt, and lighting core. I am new containerization and docker and would like some help in spinning up local environment TL;DR From my understanding this means we pretty much spin up a ubuntu vbox that then install a "package" or vagrant box that contains all the tools needed for Drupal, then use blt to start the app. Then drush to handle interacting

Why do I still need to do COPY in my Dockerfile if I'm using a Bind Mount?

坚强是说给别人听的谎言 提交于 2021-01-05 06:22:59
问题 So I'm in a developemnt environment and I'm binding my code inside a container using Mount Bind in my docker-compose file: ... volumes: - ./my-code:/home/node/app - /home/node/app/node_modules ... But I still need do COPY inside my Dockerfile in order to make this work. COPY --chown=node:node . . What I don't get is. If I'm binding my code to the container inside docker-compose.yml, why do I still need to copy all my code in the Dockerfile? 来源: https://stackoverflow.com/questions/62734082/why

Why do I still need to do COPY in my Dockerfile if I'm using a Bind Mount?

Deadly 提交于 2021-01-05 06:22:31
问题 So I'm in a developemnt environment and I'm binding my code inside a container using Mount Bind in my docker-compose file: ... volumes: - ./my-code:/home/node/app - /home/node/app/node_modules ... But I still need do COPY inside my Dockerfile in order to make this work. COPY --chown=node:node . . What I don't get is. If I'm binding my code to the container inside docker-compose.yml, why do I still need to copy all my code in the Dockerfile? 来源: https://stackoverflow.com/questions/62734082/why