Kev1n91
Kev1n91

Reputation: 3673

Are docker images bound to a specific operating system?

I am fairly new to DOCKER and as far as I know that it should enable to port software independent of the target operating system. However I have come across some projects that use "run_docker.sh" files which then have commands like these: Whole script here

docker run \
    $docker_devices \
    -v /opt/xilinx/dsa:/opt/xilinx/dsa \
    -v /opt/xilinx/overlaybins:/opt/xilinx/overlaybins \
    -e USER=$user -e UID=$uid -e GID=$gid \
    -v /dev/shm:/dev/shm \
    -v $HERE:/workspace \
    -w /workspace \
    -it \
    --rm \
    --network=host \
    $IMAGE_NAME \
    bash

Clearly /opt/ and /dev/ are unix specific folders - is it possible to port them to Windows? Is this a 'bad' use case of Docker? Is it possible to execute the docker run command with some changes on a Windows machine?

Upvotes: 1

Views: 393

Answers (1)

PassionateDeveloper
PassionateDeveloper

Reputation: 15138

Well, yes and no.

We have to be a bit specific here:

  1. Docker as a software is installable on a lot of OS, e.g. For windows: https://docs.docker.com/docker-for-windows/

  2. When installed Docker itself will operate within it's own OS, so you can switch between an Unix and Windows mode. https://forums.docker.com/t/cli-to-switch-between-linux-and-windows-images/30297

    So every image will be loaded within a a linux or windows and so are the structures (e.g. file / folder structure)

    When the image is loaded you can have a lot of OS running within the docker container, e.g. windows in every version you wish and a nearly unlimited amount of Linux OS, e.g. Ubuntu: https://hub.docker.com/_/ubuntu

Upvotes: 1

Related Questions