After half a minute or so, I could finally start a damn container ~ % docker run -rm -it -entrypoint /bin/bash debian:stable-slim But in the GUI a window opened that said Docker was starting. The above error was resolved by ticking "I accept the terms" and clicking Accept in a silly ToS that also appears to be only available to the GUI :facepalm:Īfter that, I re-opened Docker again open -a DockerĪgain, it exited immediately and no bloody output was printed on the terminal. I just clicked "OK" and typed my password into the GUI.Īfter I did that, the docker binary was available ~ % ls ~ ~ % export ~ % docker run -rm -it -entrypoint /bin/bash debian:stable-slimĭocker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. In the GUI was a window that said:ĭocker Desktop needs privileged access to install its networking components and links to the Docker apps. This time it exited 1 with an error message LSOpenURLsWithRole() failed with error -600 for the file /Applications/Docker.app. I ran sudo open /Applications/Docker.app again. You can do so as follows: xattr -r -d /Applications/Docker.app I figured, for future reference, I'd bypass this using the CLI. It's super annoying that no output was given by Apple on the CLI to indicate this, but whatever. Homebrew Cask downloaded this file on from Aplle checked it for malicious software and none was detected. "Docker" is an app downloaded from the internet. When they did, they saw a window that said I finally gave-up and had someone plug a damn monitor into the Mac Mini in the datacenter. How can I launch and enter a new docker container from the command-line in MacOS?Īs far as I know, Docker cannot be installed on a headless machine running MacOS. The only access provided is via ssh (with sudo for root permission). Note that this is a headless machine with no access to the GUI. To update your account to use zsh, please run `chsh -s /bin/zsh`.īash-3.2$ docker run -rm -it -entrypoint /bin/bash debian:stable-slim The default interactive shell is now zsh. In MacOS, I can ( insecurely) install docker as follows /bin/bash -c "$(curl -fsSL )"īut then I get command not found errors when attempting to run a new container (in both zsh and bash) ~ % export ~ % docker run -rm -it -entrypoint /bin/bash debian:stable-slim # "securely" download and run latest Debian containerĭocker run -rm -it -entrypoint /bin/bash debian:stable-slim In Debian Linux, I can execute the following commands to install docker, launch a new docker container based on the latest version of Debian, and get a shell inside that container # securely install docker and let our user interact with it Do not use it in a production deployment.How can I launch a docker container from the command-line in MacOS? * Serving Flask app 'example' (lazy loading) FROM python:3.9.10-slim-busterĮNTRYPOINT FLASK_APP=example flask run -host=0.0.0.0Īnd as a result: ❯ docker run -p 8080:5000 flask-app Indicating which port are you exposing by default is also a good thing to do (even though everyone knows that Flask exposes port 5000). Also you should choose in which working directory you would like to place your code ( /usr/src/app is a common place normally). Second, you shouldn't rely on what do you have on the base image and you should use an environment ( venv) for your application, where you can install Flask and any other dependency of the application which should be listed on the requirements.txt. There are already base images with Python like python:3.9.10-slim-buster with way less dependencies and possible vulnerabilities than an old image from Ubuntu 16. Flask is one of this modules.įirst of all, using that base image you're downloading an old version of both Python and pip, secondary: you don't need a fully fledged operative system in order to run a Flask application. I'm not going to enter into detail whether using Flask directly without a WSGI server is something you should do, so I'm just going to focus on your question.Ĭoncise answer: you don't have the installed modules by pip in your PATH, so of course you cannot invoke them. Well, indeed you're following a really old tutorial.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |