Run docker container extracted from Ubuntu in Windows - linux

I have an Ubuntu machine that contains a docker container.
For reasons I cannot run the server, but I can access the files trough a file explorer.
I found the docker folder in var/lib/ is there a way to copy and run that on a windows machine in a windows docker?
I cant run any of the docker commands on the Linux system as I cannot access it.
Is it possible or do I have to have the system running?
Thanks in advance! Sorry if it's a bad question I'm very new to this and can't find a similar enough case.

Related

how docker executes windows container?

As i understand, docker use linux VM even i install it on windows OS.
So i agree that windows docker can execute linux container.
But then, how windows docker executes windows container?
Can i make container with other OS?
In other words, can i make container(having windows & windows app) and run it on linux docker?
As i know, docker does not support other OS in image, but it looks like some people is saying it is possible that make windows container and run it on linux.
Docker container shares just one kernel, is it possible?
To answer your questions:
That first statement is incorrect. Docker uses the underlying OS feature (container) to run its stack/daemon. The OS is responsible for instantiating the container itself. That means a Linux OS will instantiate a Linux container and Windows host will instantiate a Windows container. So, if you install Docker on Windows you don't have a Linux VM. Instead, you have the ability to instantiate Windows containers directly without the need to run Linux at all. To answer the question itself: The process is pretty much the same as Linux. You pull images with docker pull and then run them with docker run. You can also build images with docker build and everything else.
Windows containers can only run on Windows hosts (either Windows 10/11 or Windows Server). For Linux containers, that's not so strict. You can run Linux containers on Windows for development purposes, by leveraging the Windows Subsystem for Linux (WSL).
There's much more details on these on the Microsoft documentation page: https://cda.ms/4nN

Running an msi from Docker. Which host OS should choose

I want to create a docker container which installs an MSI application. I know i will be using the microsoft\widows\servercore image for this. Which host os i should use for this purpose. Will this image can be created and deployed in a Linux distribution??
If you're running a Windows container, you need to use Docker on Windows.
In general, containers can only run on the OS that they're designed for, but it is possible using Docker for Windows and Docker for Mac to run Linux containers since they provide a miniature Linux VM to run those containers. However, Docker on non-Windows OSes doesn't provide a copy of Windows to run containers with, so you have to use Windows to run Windows containers.
If you want your container to be deployable on a Linux host, it will need to be using a Linux container image.

Docker container works on Ubuntu but fails to run on MacOS

Sorry if this is a stupid and/or widely known question.
I've written a docker that basically just runs a single process then exits. It runs fine on my ubuntu machine 16.04 and its been tested on another ubuntu machine. However, someone else has tested out the docker on macos and the docker did not run to completion.
Is this a known limitation of docker? i.e. can linux dockers only run on linux, macos dockers only run on macos, etc... Or is it even more restrictive in that is only works on the same OS (i.e. ubuntu dockers should only be run on ubuntu).
The docker itself is an image processing pipeline. We run it by mounting a directory that contains the image and then mount an output directory as well and just run a process inside the container. I'll post more details of the docker if that's important to the answer.
Since docker runs as a vm on macos, you have to specify the memory. The docker uses 8 gigs of ram and was running out of memory. The solution was to boost the vm memory to 8 gigs and it worked fine...

Running linux container on docker windows

I installed Docker for windows on a windows 10 box. It required me to enable the HyperV feature on it. Everything installed correctly and is running fine.
Although one thing took me by surprise. I am actually able to run a linux container on docker windows. I thought cross-containerization is not possible conceptually. Can anyone please help me understand how does this work?
HyperV is used to spin up a Linux VM to run containers. Docker is still running Linux containers under the covers, the native Windows containers are still being developed.
Basically, you are running a Linux Container on a Linux Machine rather than Windows. Windows runs a VM in Hyper-V when you download the Docker for Windows. You can open Hyper-V Manager and see a Linux VM will be running. Currently Docker for Windows is in beta which supports the Docker natively which needs Windows 10 build no. greater than 14393.222 or a Windows Server 2016.

Linux dev environment in osx (docker as mv or any other)

I'd love to hear from you some advice on setting up what I'm looking for.
I'm using OSX and I need to develop some code on a Linux machine, the thing is that I was looking for some VM alternative since it takes too much battery power.
The first thing I come across with was a docker container. I know It is not what it was designed for, but I thought it might work anyway. So I tried running a container as
docker run -i -t ubuntu /bin/bash
and it worked well. However all the changes I make are gone and I can't fins a way to solve it. I also tried
docker run -i -v /Users/JaimehRubiks/test:/home/Jaime -t ubuntu /bin/bash
and all files in there are saved (also very interesting because I can share my files with host), but it's kind of boring having to commit to the docker image if I change anything in the config files of my ubuntu.
What I'm looking for is just a simple way to run linux in my mac, and then access to it somehow, like I did in docker or via SSH.
Docker currently does not run natively on osx as Docker relies on the Linux kernel for its isolation features. In fact, the Docker Toolbox uses a Virtual Box virtual machine running the boot2docker Linux distro to run the Docker daemon on osx. See the official documentation on Mac osx installation.
The boot2docker linux image is quite light weight, but I'm not sure you will get much benefit from running Docker on osx for Linux development over simply running a full Virtualbox machine with Ubuntu (or other distro). If you want to run a virtual machine vagrant is a good tool to help you set that up. It lets you easily pull down images from an image repo, setup the image, and ssh into it. It also makes host -> guest-machine folder sharing and port forwarding quite simple.
but it's kind of boring having to commit to the docker image if I change anything in the config files of my ubuntu.
You don't have to docker commit anything: any file change make on the host (/Users/JaimehRubiks/test) will be visible in the container (/home/Jaime)
what about using vagrant to run Ubuntu or CentOS? you can access the system via command vagrant ssh and configure it with configuration file and share it like using docker.

Resources