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

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/

Related

Docker without docker dekstop. How to run Dockerfile

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.

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.

Docker Swarm, Windows Containers, ingress network (Routing Mesh) on Windows Server 2019

I want to build docker swarm cluster on windows. To do this I choose Windows Server 2019 in 1809 Version. I work on my local machine and using Vagrant box vm.box=StefanScherer/windows_2019 I created enviroment for developing purposes.
Set Hostname.
Set private network (192.168.52.100)
Install Docker-EE
On this Windows I have installed docker-ee by using command Install-Package Docker -ProviderName DockerMsftProvider -RequiredVersion 19.03 -Force, and docker work perfectly.
docker version return everething ok
docker run -it --rm -p 8000:80 --name aspnetcore_sample mcr.microsoft.com/dotnet/core/samples:aspnetapp -> also work perfectly.
My first issue is when I perform command docker swarm init --advertise-addr=192.168.52.100 I notice my internet connection is lost for a while (also init/join/leave).
And the secound issue is routing mesh, it is not working
Steps to reproduce:
docker service create --publish published=8050,target=80,mode=ingress --name aspnetcore_sample mcr.microsoft.com/dotnet/core/samples:aspnetapp
Open web browser http://127.0.0.1:8050/ (on machine where I init swarm)
Now I should have access to this sample app under 8050 port. But http://127.0.0.1:8050/ is not working
I know I can use mode=host but I think mode=ingress should work.
I also checked it with the same commands on linux and it works without any problem
How can I resolve this issue?

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 deploy docker images from the Docker on MacOs to the Docker machine in the VirtualBox on Windows

I have 2 machines :
1) MacOs laptop
2) Windows 7 pc.
Mac is too slow for deploying the whole application. So, i've created the docker machine on windows.
docker-machine create -d virtualbox my-app
docker-machine env my-app > connect.bat
I have the docker machine, that is accessible from the Windows by the tcp://192.168.99.100:2376.
Then I am able to build and run my docker images in that machine by
docker-compose build <image>
docker-compose up <image>
The issue is, that I need to have the application sources on this machine to be able to build containers from it, and as a result I need to code on this machine as well and connect to it through remote desktop that is very unconvinient.
The desired configuration is next: develop on Mac, then compile sources on it, build docker images and deploy to the docker machine that is running on Windows inside VirtualBox.
I've started trying to connect to this docker machine from Mac, copied the certificate files and try to connect
docker --tlsverify --tlscacert=ca.pem --tlscert=cert.pem --tlskey=key.pem -H=<WINDOWS_MACHINE_HOST>:2376 version
and get error during connect: Get https://<WINDOWS_MACHINE_HOST>:2376/v1.32/version: x509: certificate is valid for 192.168.99.100, not <WINDOWS_MACHINE_HOST>.
Attempts to regenerate the certificates by the instruction (https://docs.docker.com/engine/security/https/#secure-by-default) didn't help. I still got the same error.
The question is such case ever possible? If yes, the question is how? Would appreciate for any help

Resources