Use existing file sharing / volumes in Docker-compose with Docker for Windows WSL2 - docker-for-windows

With Docker for Windows 10 pro Hyper-V I work normally with File sharing. So in the Docker Desktop section Resources I add a folder like K:\data on my Windows host. This works well for me for many years.
So my current configuration is:
Windows 10 pro
Data folder on Windows 10 HOST is e.g. K:\data
Docker for Windows with Hyper-V
Docker compose (stack) file with 2 Docker images: MySql and Jenkins.
Docker components both access the data that is (via a volume specification) residing on the Windows host.
I investigate if I can switch to Docker for Windows WSL2. Then I would like to continue using the docker compose file with the 2 Docker containers. I would like to continue using the data that is residing on the Windows host. More specifically, on the K:\data.
Is it possible to switch from Docker for Windows with Hyper-V to Docker for Windows WSL2 and still use the existing data residing in the Windows folder?
This is not a duplicate question: I work with Docker compose, so I don't want to use the "docker run -v 'host'" solution. In my docker compose file I use e.g. the following line:
volumes:
- //k/data/spring-boot-app:/data/spring-boot-app
This question gets more important because since the new 2.5+ version, the Hyper-V version is hardly working on my standard Win10pro. The WSL2 worked immediately.
I pose this question as a simple user question, so others may benefit from it. I know that there is a world behind this topic.

Easy does it -- just switching to WSL2 works. I tried both the Docker for Windows 2.4 and 3.0.0 (21-12-2020) version.
Let me proof and explain in 2 simple steps. Take care of the way the volumes are used in the docker-compose.yml file.
First, just enabled the WSL2 in your Docker Desktop
1 - Demo with a simple app:
version: '3'
services:
chatbot:
image: myusernameatdocker/chatbot:1.0-SNAPSHOT
ports:
- 8080:8080
volumes:
- /k/data/chatbot:/data/chatbot
I created a simple Spring Boot application. It writes 1 line to my log file on Windows. That file I could perfectly read. Just on k:\data\chatbot\myfile.txt.
2 - Demo with an existing MySql environment:
version: '3'
services:
mymysqldb:
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=root123
- MYSQL_DATABASE=mydatabase
- MYSQL_USER=johan
- MYSQL_PASSWORD=bladibladibla
volumes:
- /k/data/var/mysql-data:/var/lib/mysql
ports:
- "3306:3306"
I just started it and it works. Normally I had first to add a k:\data folder on first installing Docker. Now I didn't do that yet.
AND ... working with //k/data also worked. So, the MySql I use for many years still works.
Did I get the warning that accessing the Windows file system is slow? Yes. OK, in my case for development work not a big deal. It's okay, it works!

Related

How to recover containers and images in WSL2 that go missing after installing Docker Desktop?

I'm attempting to use my WSL2 docker containers with VS Code, though I now regret this. I attempted to follow these directions to get everything installed and configured correctly.
After installing Docker Desktop, my previous containers and images are not shown with docker ls and docker images when run from WSL2. However, there are still many GB of data under /var/lib/docker. Is there some way to attempt to recover this?

Error on Harbor as Docker Hub proxy when "Prevent Vulnerable Images" is enabled

I am using Harbor as Docker Hub Proxy, where the docker daemon was configure to point for this registry. This part is working ok.
But, I find a problem when I enable the option "Prevent Vulnerable Images" following the image below to the "library" project.
https://i.ibb.co/fDZKWN1/harbor.png
If this options is checked, the docker pull command don't work, showing the error below, but if is unchecked, the command work ok.
https://i.ibb.co/D9cMCXQ/error.png
- harbor version: v1.8.2 (online)
- docker engine version: 18.06.1-ce
- docker-compose version: 1.24.1
Github issue: https://github.com/goharbor/harbor/issues/9094
So far, Harbor does not fully support the registry mirror/proxy function. The good news is registry proxy/mirror is put into the Harbor roadmap now, you can check it here.

Do Redis images currently work with Docker on Windows?

I am running Docker with Linux containers. When I try to do a Redis pull I get "docker: no matching manifest for windows/amd64 in the manifest list entries." I have seen many tutorials showing redis running on docker windows. Has something changed with later versions of redis which means that it no longer works with docker on Windows?
start dockerd.exe with the --experimental flag and your problem will be solved.
easy find on google:
https://github.com/docker/for-win/issues/1100
https://blog.docker.com/2017/09/preview-linux-containers-on-windows/

Docker with an Apache is restarting in a loop

I have a Ubuntu 14.04 which run an app supported by Docker (version 17.05.0-ce, build 89658be) and docker-compose (version 1.16.1, build 6d1ac21). One of this dockers contains an Apache which is restating in a loop.
Is there a way to fix this without losing dockers customizations?
I re-created all dockers with
docker-compose up --force-recreate
I didn't lose anything and everything is working now.

-restcomm configuration for Windows

I am beginning to set up on Restcomm Mobicents framework.
In particular I am trying to set up Restcomm on my Windows 8.1 laptop.
Can anyone assist with how to set up RESTCOMM on Windows Server please. The reason I ask this is that most of the information is presumed to be on Linux, Ubuntu. Environments like "installation of screen" and also any sample configuration shared are for Ubuntu, Linux environments, but not specifically on Windows.
Restcomm is currently prepared to run natively on Linux operating systems, indeed.
Considering the diversity of OSs and configurations, a Docker image was created to gather everything Restcomm needs to run properly, as an independent layer.
Please check the following links to install Docker in Windows 8.1 and use Restcomm docker image.
About docker: https://www.docker.com/what-docker
Docker installation: http://docs.docker.com/windows/step_one/
About Restcomm docker image: http://www.telestax.com/docker-image-for-mobicents-restcomm-7-3-0/
Restcomm docker image: https://hub.docker.com/r/gvagenas/restcomm/
You should avoid installing Restcomm on windows, although the simulation will work, when you will have to go live, you will be unable because Windows does not implements the SCTP stack need by Restcomm.