Docker without docker dekstop. How to run Dockerfile - docker

I want to run docker container on windows without docker desktop.
I dont know how it could work.
I installed Ubuntu on Windows (from Microsoft Store).
In Windows cmd i can write 'wsl' and then it brings me to Ubuntu cmd. In Ubuntu i installed Docker and its working.
Now I have project on Windows with Dockerfile. How can i run it ?
Because i have two systems Windows with my project and Linux with docker. What i have to do now to makes it works ?
Thanks

In your WSL navigate to your Dockerfile location. /mnt/c is the windows C: drive location inside the WSL. Build your Dockerfile with docker build. Run it with docker run. If the docker commands complain about the docker daemon not being reachable you need to start it with sudo service docker start.

Related

How to run CLI on docker desktop on windows11

I am new to docker world. I have installed docker desktop for windows on my win11 machine.
When I run docker version. I get this below information.
Can someone please guide me on how I can get docker CLI working so that I can get an interactive window of the run-time containers.

Debug python code running in a docker compose on a SSH remote development machine

I run a docker-compose (python) application on a remote machine, which I can access via SSH for remote development with VS Code.
I'm running the docker compose application on a Ubuntu 22.04 LTS machine and develop from a Windows 10 notebook. The remote machine has docker desktop 4.11 installed, as well as the Docker Extension Pack for VSC.
When I open the folder on the remote machineand start the application, I can see the that the docker images are created and containers are running. But when I try to attach a Visual Studio Code to the running container I get the error:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Is there a way to debug the code inside the docker containers?
Seems like the docker engine fo docker desktop is not found by the docker extension of VSC. Docker desktop for Linux is installs the docker engine in unix://home/<user/.docker/desktop/docker.sock and not under the standard docker engine path mentioned in the error messageunix://var/run/docker.sock. See Switch between Docker Desktop and Docker Engine
So my solution is to install the Docker Engine instead of Docker Desktop until a fix of VSC or the VSC Docker extension is available.
After attaching Visual Studio Code to the running container you can debug the application in the same way as on your do on your own machine.

docker daemon can't running on ubuntu container

On my windows 11, I install Docker Desktop and ubuntu image.
On ubuntu container, I want install dapr,but dapr depends on docker
dapr init
⌛ Making the jump to hyperspace...
❌ could not connect to Docker. Docker may not be installed or running
so, then I install docker on ubuntu container, but the docker can't run (I have set export DOCKER_HOST=tcp://127.0.0.1:2375). how to solve this issue? Thanks!

Run windows container on docker toolbox?

I am trying to run microsoft/iis:latest image on my docker toolbox set-up in my Windows 10 Home.
As expected, with the containers running on a virtual linux VM, i get the below message.
$ docker run -it microsoft/iis
Unable to find image 'microsoft/iis:latest' locally
latest: Pulling from microsoft/iis
C:\Program Files\Docker Toolbox\docker.exe: no matching manifest for linux/amd64 in the manifest list entries.
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.
Is there a way i can run such containers on toolbox, without using 'Docker for Windows' set-up?
Thanks.
Nope, you cannot run Windows containers in Windows Home. Windows containers run directly in the OS without the intervention of Docker Desktop. Docker Desktop is only a convenient interface in this case.
You can install in Virtualbox Microsoft Hyper-V Server with is free and there (I think) you can run Windows Containers.

How to Run Jenkins in a Windows Docker Container on Windows 10?

I am trying to run Jenkins in a docker container on my Windows 10 box. I am using a Windows container, not a Linux container.
I tried to use this guide: https://jenkins.io/doc/book/installing/#on-windows
However the command to enter is for Linux containers, not Windows containers.
I can't seem to get Linux containers to work due to a known issue with them after the 1709 update (https://github.com/docker/for-win/issues/1221).
I tried "docker pull jenkins" however there's no amd64 version to pull.
Any ideas here? My only other thought is trying to figure out how to run Java from a windows container so I can use the Jenkins .war file instead?
Actually, I was able to run Jenkins Linux container on my Windows (Build 1709)
machine. However, this version of Windows and Docker (17.12.0) run Linux Containers on top of Hyper-V. So you need to enable Hyper-V before taking the following steps.
Right-click on the whale icon and click on Switch To Linux Containers
run docker pull jenkins/jenkins:lts in Powershell
run docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts in Powershell
Get The IP of your container and use your browser to open Jenkins Panel on port 8080.
Besides that, I found there are several Jenkins Windows Images. Such as:
https://www.assistanz.com/installing-jenkins-through-docker-file-for-windows-container/
https://asmagin.com/2017/05/02/jenkins-on-docker-for-net-projects/

Resources