docker-for-windows

Mount Postgres data to Windows host directory

余生颓废 提交于 2019-12-08 17:30:13
问题 I want to ensure my Postgres data (using Linux based image) persist, even after my Windows host machine restart. I tried to follow the steps How to persist data in a dockerized postgres database using volumes docker-compose.yml volumes: - ./postgres_data:/var/lib/postgresql/data However, I'm getting error waiting for server to start....FATAL: data directory "/var/lib/postgresql/data/pgdata" has wrong ownership HINT: The server must be started by the user that owns the data directory. stopped

Docker for Windows Swarm IIS Service with Win10 Insider running but unreachable

狂风中的少年 提交于 2019-12-08 10:32:06
问题 I'm currently experimenting with Swarm Services with Docker for Windows. The new Win10 Insider build supports overlay networking for Windows containers and I was pleased to see my IIS service actually starting. The only issue i came across is that i can not reach the service in the browser, despite trying multiple things such as different ports and networks. The command issued is as following: docker service create --name webfarm -p 80:80 microsoft/iis I have also tried to use the --network

Docker for Windows does not work with Volumes

拟墨画扇 提交于 2019-12-08 09:37:11
问题 I'm trying to create a project with ASP.NET Core, Docker Desktop for Windows and Visual Studio Docker Tools . So I've create a ASP.NET Core Empty Project and added Docker Support via context menu. My docker-compose.debug.yml looks like this: version: '2' services: aspnetcore_rtm_windows_docker_sample: image: username/aspnetcore_rtm_windows_docker_sample:Debug build: context: . dockerfile: Dockerfile.debug environment: - REMOTE_DEBUGGING=${REMOTE_DEBUGGING} ports: - "80:80" volumes: - .:/app

Access file of windows machine from docker container

寵の児 提交于 2019-12-08 07:02:28
问题 I have installed Docker Desktop for Windows in Windows 10 operating system. I am running a python script inside docker container which reads file from disk and add few text at the end of files. Now the requirement is to read files from Windows 10 and perform the same operation on it. Is it possible in docker to read files from OS on top of which Docker is running? 回答1: Of course, you can use volumes. For example, you can run the following command: docker run -v path/to/your/file/on/host:path

yum update / apk update / apt-get update not working behind proxy

别等时光非礼了梦想. 提交于 2019-12-07 15:20:22
问题 I'm behind a proxy and I'm not able to build a Docker image. I tried with FROM ubuntu , FROM centos and FROM alpine , but apt-get update / yum update / apk update failed. My host OS is Windows 10, so I configured my Docker settings to use our proxy. And I also added ENV http_proxy http://<PROXY> ENV https_proxy http://<PROXY> to my Dockerfile but no success. I also tried to set my proxy to http://<USER>:<PASS>@<PROXY> , but again no success. I am able to pull Docker images. When I set my

Cannot call chown inside Docker container (Docker for Windows)

和自甴很熟 提交于 2019-12-07 05:26:28
问题 I am attempting to use the official Mongo dockerfile to boot up a database, I am using the -v command to map a local directory to /data inside the container. As part of the Dockerfile , it attempts to chown this directory to the user mongodb: RUN mkdir -p /data/db /data/configdb \ && chown -R mongodb:mongodb /data/db /data/configdb VOLUME /data/db /data/configdb However, this fails with the following command: chown: changing ownership of '/data/db': Permission denied What I am doing wrong

How to restart docker for windows process in powershell?

∥☆過路亽.° 提交于 2019-12-07 02:46:31
问题 I want to restart docker for windows in powershell. just like I can do it with one command in powershell. May I implement it? When using Restart-Service *docker* : 回答1: Kill and restart the docker process: $processes = Get-Process "*docker desktop*" if ($processes.Count -gt 0) { $processes[0].Kill() $processes[0].WaitForExit() } Start-Process "C:\Program Files\Docker\Docker\Docker Desktop.exe" In the if clause I check if any running docker process has been found. There should never be more

Call Microservice from another Microservice within Docker

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 02:29:29
I created several Microservices in C# that are running on docker in windows, I need to call Microservice from another Microservice so I used this way to call: [HttpGet("GetOrder/{Object_ID}")] public Order GetOrder (int id) { string Baseurl = "http://189.29.0.100/"; ….. using (var client = new HttpClient()) { //Passing service base url client.BaseAddress = new Uri(Baseurl); client.DefaultRequestHeaders.Clear(); //Define request data format client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); //Sending request to find web api REST service resource

Cannot create Windows docker machine? “Hyper-V PowerShell Module is not available”

怎甘沉沦 提交于 2019-12-07 01:40:43
问题 I just installed docker and tried to create a Windows (not Linux) docker machine but it failed? PS C:\> docker-machine.exe create --driver hyperv default Creating CA: C:\Users\...\.docker\machine\certs\ca.pem Creating client certificate: C:\Users\...\.docker\machine\certs\cert.pem Running pre-create checks... Error with pre-create check: "Hyper-V PowerShell Module is not available" I downloaded the newer version of docker-machine (https://github.com/docker/machine/releases/tag/v0.15.0) and a

How to pass parameters to a .NET core project with dockerfile

北战南征 提交于 2019-12-06 17:55:15
问题 I've got a .NET Core project (using visual studio and adding the docker files via the Visual Studio Tools for Docker). My DockerFile looks like this: FROM microsoft/dotnet:1.0.1-core ARG source=. WORKDIR /app COPY $source . ENTRYPOINT ["dotnet", "MyApp.dll"] CMD ["arg1", "arg2"] My question is, how do I pass parameters into the project? public static void Main(string[] args) { // how does `args` get populated? } 回答1: I used environment variables which can be set by docker-compse.yml too