Cant start docker containers from Docker Desktop in Mac - macos

I've used docker desktop in Linux and Windows without problem, but i recently got a mac, and when i try to start a docker container i have setup via Docker Desktop, the docker container starts, but immediately just changes from "Running" to "exited" status.
This doesnt happen in the other environments i use docker, so any help would be appreciated.
I have been trying to find any kind of logs, but i cant find any.
im using mac os x 11.7.1 (Big Sur)
Docker desktop is the newest version 4.16.2
I have tried so far:
Reinstalling Docker Desktop
verified and ensured the permissions for access to docker are set correctly (access to files and folders)
I have setup my dockerhub account
Im using the latests versions of the php and python images available at docker hub.
Thank you.

Related

How to run TackleTest using Docker image on Windows 10?

We are running on Windows 10. Instructions said to mount a working
directory to a docker container. We have everything and still can't
get Tackle Test to run tests on applications. What are we missing?

Is possible to uninstall docker desktop on MacOSX and keep docker docker-engine and VMs working?

I'm using docker for a while and when I installed it I didn't note if the command line and the GUI Docker desktop were installed as two separate things. So I want to uninstall only the docker desktop but keep the command line working on MACOSX 11.
Is that possible? How can I do that?

Docker for windows Vs Docker inside Windows Ubuntu App?

I am trying to know the best way to run Docker in Win 10 machines that dosn't have too many resources.
I am runing Docker using the docker for windows and things run quite good but I wonder if it will be better specialy about symlinks issues and resources hunger if i run Docker inside the new Ubuntu on Windows. https://www.microsoft.com/es-es/p/ubuntu/9nblggh4msv6?activetab=pivot:overviewtab
When you try to install Docker in Ubuntu for Win a message shows advising to use Docker for Windows instead.
Any thoughts out there ?

What is the recommended way to develop docker containers for Linux on Windows?

Background
I am developing a Spring Boot application that will be deployed on Linux Redhat.
As this is a Java application, I can develop on Windows 10 and this is my preference.
To simplify deployment, I have dockerized the application.
Objectives
I would like to test the container on my Windows 10 development computer:
Without installing a VM
Without using Hyper V as a VM.
Without WSL 2.0 (WSL 1.0 can be used)
I need to create a volume so that data written by the container can be accessed on the Windows host during and after the container runs.
The scripts I write to load and run the docker should be as similar as possible as those I will use to deploy on the target Linux Redhat server.
What I have tried
I have installed Docker for Windows on my Windows PC and followed the documentation to allow me to run docker in WSL 1.0.
There are a number of tweaks that need to be done to make this work, and I am still not able to configure a volume to meet my requirement.
Curiously, I happened to try to run the container using docker on from a Windows command prompt and it seems to run too. (though volumes still do not work here either).
This surprised me because I thought that a Linux image can only be loaded into a Linux OS as docker does not run the container in a VM.
My questions
Can I indeed test my Linux container using the Windows prompt or may I run into issues down the road? (issues meaning differences in deployment and run time behavior compared to deployment and running on the Linux target machine).
If a Linux container can run from the Windows prompt, do I even need WSL to run the docker on my windows PC?
What are the advantages, if any, of using WSL to test and test the container in development considering the fact that docker on WSL 1.0 seems to require a little work to get running "flawlessly" on Windows?

Can I run Windows containers on Docker Desktop for Mac? [duplicate]

This question already has answers here:
How can I run a docker windows container on osx?
(3 answers)
Closed 1 year ago.
This post was edited and submitted for review 1 year ago and failed to reopen the post:
Original close reason(s) were not resolved
I want to be able to run Windows Docker Containers on my Mac, it seems this was sort of supported using Docker Toolbox
How can I run a docker windows container on osx?
But it seems that this is now deprecated and we should be using Docker Desktop now.
Docker Desktop has a better and New Hypervisor called HyperKit instead of Virtual Box https://docs.docker.com/docker-for-mac/docker-toolbox/
Docker toolbox allowed starting Windows Containers using VirtualBox, so not sure if that mean's that this is still possible?
I have found a reference to putting Docker Desktop into "Windows Container Mode" here https://www.clearpeople.com/insights/blog/2018/june/sitecore-demo-in-a-docker-container
But I cannot find anywhere to enable this, any help or insight would be very much appreciated.
There is a related question here How can I run a docker windows container on osx? but it's so old that is irrelevant and should not be a reason to lock this question.
Docker only runs natively on Linux machines because it needs Linux kernel features called namespaces and control groups. Docker containers are built from cut down Linux distributions.
The original solution to running Docker on OS X and Windows was Docker Toolkit. This was actually a Linux virtual machine running in the VirtualBox Hypervisor. The VM had Docker installed and could run containers.
Docker Desktop for Mac still makes use of a virtual machine running Linux running in the HyperKit Hypervisor. This virtual machine is lightweight and effectively hidden from the user.
Likewise Docker Desktop for Windows makes use of a virtual machine running in the Hyper-V Hypervisor. It can also run Windows containers.
To run Windows containers you need to have a Windows machine running Docker. The Windows machine can be virtual machine running on a Mac or Linux machine.
I know I am late to the party but as of 2021, this is the easiest setup to get a windows container running on macOS:
https://github.com/StefanScherer/windows-docker-machine
Install vagrant and virtual box
Clone the repository above and change directory into it
vagrant up --provider virtualbox 2019-box
docker context use 2019-box
I followed this setup and I could use the following windows image
mcr.microsoft.com/windows/servercore:ltsc2019
Please note that the windows version of your host must match the container image. This is mentioned here: https://hub.docker.com/_/microsoft-windows
Windows requires the host OS version to match the container OS
version. If you want to run a container based on a newer Windows
build, make sure you have an equivalent host build.

Resources