Home > database >  Getting a Windows Docker Container running with .gitlab-ci.yml
Getting a Windows Docker Container running with .gitlab-ci.yml

Time:12-04

I am trying to get a Windows docker container running with Python3 using my Gitlab pipeline script. But it seems that the yaml configuration below only starts a Linux docker container. How can I configure my .yml file to start a Windows image with the latest version of python?

.gitlab-ci.yml:

image: python:latest

CodePudding user response:

You're getting the linux version of the python container because GitLab's shared runners use linux. Due to how containers work, they share the kernel of the host machine, so a linux runner can't "host" a windows container - it simply doesn't have the kernel instructions to run it.

If you want to run a windows docker image, you will need to have a windows server with a supported version that you're self hosting. You will also need to ensure that the windows docker container you're using works properly.

All of this having been said - if you're trying to use python, just run it in Linux. It seems like there are vanishingly few reasons you would need python to be running specifically on windows for your CI/CD, but if you let us know what they are we may be able to help.

  • Related