Laravel on windows with Docker and Linux subsystem issue - laravel

When running with Docker on Windows and using linux subsystem (WSL version 2) I can't get Docker to delete any container that I want to remove. Anyone else had this problem on windows and how to solve it?
See screenshot to how Docker responds:
Docker says "can't remove docker container, reason being that folder in question '/home/niko/laravel-app1', it's path can not be found.
however I can navigate to this folder via Explorer \wsl$\Ubuntu-20.04\home\niko\laravel-app1
Anyone had any experience with this and how to get Docker to understand where the files actually are so it can delete the container when I ask it to do so?

Related

Run Virtualbox inside docker container, on Windows host

I know this is not what docker containers should be used for, but hear me out. I'm trying to port over a local environment that is currently run on Windows 10 with Chef, Vagrant & Virtualbox.
I believe it is possible to do this in Ubuntu by installing Virtualbox on the host, then mounting the /dev/vboxdrv directory into the container. While there is a vboxdrv directory for the Windows installation C:\Program Files\Oracle\VirtualBox\drivers\vboxdrv, it won't work for a Linux-based container.
Is it possible to get Virtualbox running inside of a Docker container while on a Windows host? I doubt it, but thought I'd ask to confirm in case I had missed some nice workaround.

why docker container is not runnig in windows?

Help me friends, please. I'm a noob in docker.
I'm working with laravel an create project with Docker in location.
root#VIGIA-PC:/mnt/d/projects/fastfood-app/fastfood-api#
docker was working but when I shut down my pc, and then I turn on it, the docker container is not running, why?
when I go to to the project folder and type ls no appear files from debian terminal, when I going to windows they are here.
I runned docker ps and show the follow:
Information
windows version 10
distro linux debian
build 19042
Docker version 20.10.2, build 2291f61
You'll have to change the behavior of your docker apps.
If the host is being restarted, so are the containers running on it : https://docs.docker.com/config/containers/start-containers-automatically/
I have already solved my problem.that was a problem from path

Cannot create file with Jupyter Notebook running in Docker in Windows 10

I have installed Docker Toolbox for Windows v 18.09 in Windows 10 Version 10.0.19041 Build 19041 and am trying to run a docker container to run Jupiter Notebook with Pyspark.
I am using Windows Powershell to execute docker commands
docker run hello-world works fine so I can assume that Dockers has been installed correctly. Infact, I had go down to Toolbox v 18.09 before I could get hello world to work.
i use the following command to run the pyspark container
docker run -it --rm -p 8888:8888 --volume=//C/Users/prith/pydev://home/jovyan/work jupyter/pyspark-notebook
from the C:/Users/prith/pydev directory that is mapped to the work directory of the container. The // is slash is required because i am working with Windows. the notebook shows up in http://192.168.99.100:8888 as expected and I can login with the token.
Then the problem starts when i try to create a new notebook or even a text file, I get a permission denied error. Evidently the container cannot write to 'some' directory. I have used Windows filesystem properties to give Everyone all privileges on this particular directory and have also run the Powershell in Adminstrtor mode ( to simulate Ubuntu sudo ..) but nothing works.
Interestingly, I can write into the directory located above the work directory in the container but then I cannot access files written into that directory from Windows because I have mapped my local windows directory to /home/jovyan/work
What do what i want? I want to create Jupyter notebooks in the container and save them in Windows
I know all this works like a charm in Linux-Ubuntu, but unfortunately I am stuck with Windows 10. Please help.
It looks you forgot to add the directory you're trying to mount to FILE SHARING.
Please, do right-click on docker icon (in system tray) -> Settings -> Resources -> FILE SHARING
Then, add your local directory.
Finally, if it doesn't work, try to mount volume with --volume="C:\Users\prith\pydev":/home/joyvan/work
this command seems to work
docker run -it --rm -p 8888:8888 --volume='/c/Users/Public/PyDev'://home/jovyan/work jupyter/pyspark-notebook start-notebook.sh --NotebookApp.token=''

How to install only Docker client on MacOS?

Docker can work decently remotely by defining DOCKER_HOST variable but now I do want to avoid installing the fat Docker for MacOS which also installs and starts the docker engine on a VM, one that seems to consume resources.
As docker work remotely it should continue to be able to build images, list images, start and stop them without having a docker servic/vm mac.
How can I do this? (docker cli seems to be come only with the entire cow).
I guess you are looking for install-client-binaries-on-macos.
Docker company afford some prebuilt binary, just download here, unpackage it, then you will find a standalone docker client binary there, copy it to your mac, out of the box for use.
There seems to be no install of the client only; but after installing the fat cow, you can tell it to stay off your grass by unchecking Start Docker Desktop when you log in in the preferences, and then shut down the Docker server.
That's what I do, and when I need docker locally I just start and then after using it, I shut it down again.

Docker: Mount volume from Windows host

I use 1.12 version of Docker on Windows, since I can't use the Hyper-V feature with the newer "native" version - so I have my quickstart terminal and communicate to docker host via the invisible underlying virtual box.
Now I have the problem, that I need to mount a local folder to a container, which worked successfully from within the docker-machine by adding
--volume="`pwd`:/root/data"
to the docker run command, but it does not when I launch the same command from my Windows quickstart terminal (even though pwd command works correctly in the terminal).
I tried to find the Windows specific settings for the directory and tested several combinations of format, but no luck. Can anyone help me out on how to correctly specify a Windows folder (e.g. C:\Users\alexander.ruehl) for the volume parameter?
You can use relative path for your volume : --volume="./mydata:/root/data"
Also make sure that you have given the permission for read/write to Docker.

Resources