why docker container is not runnig in windows? - laravel

Help me friends, please. I'm a noob in docker.
I'm working with laravel an create project with Docker in location.
root#VIGIA-PC:/mnt/d/projects/fastfood-app/fastfood-api#
docker was working but when I shut down my pc, and then I turn on it, the docker container is not running, why?
when I go to to the project folder and type ls no appear files from debian terminal, when I going to windows they are here.
I runned docker ps and show the follow:
Information
windows version 10
distro linux debian
build 19042
Docker version 20.10.2, build 2291f61

You'll have to change the behavior of your docker apps.
If the host is being restarted, so are the containers running on it : https://docs.docker.com/config/containers/start-containers-automatically/

I have already solved my problem.that was a problem from path

Related

How can run Docker in linux 20.04 in Windows 11

Hi, I have this problem, trying to running Docker in Ubuntu 20.04 in windows 11 using the WSL, I installed it using the official documentation in https://docs.docker.com/engine/install/linux-postinstall/, I tried with some commands like:
sudo service docker start | restart
Show me OK but this didn't work when I tried to execute again the run hello-world command.
Can you help me please?
You should install Docker for Windows and manage it from there, rather than a service within WSL. Then in the preferences, you can link it to WSL2, where it'll install the Docker CLI.

Laravel on windows with Docker and Linux subsystem issue

When running with Docker on Windows and using linux subsystem (WSL version 2) I can't get Docker to delete any container that I want to remove. Anyone else had this problem on windows and how to solve it?
See screenshot to how Docker responds:
Docker says "can't remove docker container, reason being that folder in question '/home/niko/laravel-app1', it's path can not be found.
however I can navigate to this folder via Explorer \wsl$\Ubuntu-20.04\home\niko\laravel-app1
Anyone had any experience with this and how to get Docker to understand where the files actually are so it can delete the container when I ask it to do so?

Docker for Desktop error during connect: Post A connection attempt failed because the connected party did not properly

I have freshly installed Docker for Desktop Edge in Windows 10 Home and try to build an image using the docker build command. But unfortunately, it didn't work for me, and got the below error :
CMD - docker build -t heet1996/post:0.0.1 .
error during connect: Post https://192.168.99.100:2376/v1.40/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&session=na8ugnpn6d8gnxl3z8ppx4gap&shmsize=0&t=heet1996%2Fpost%3A0.0.1&target=&ulimits=null&version=1: dial tcp 192.168.99.100:2376: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Earlier I was using a docker toolbox so I had to remove all the environment variables related to the Docker in my User variables before installing Docker for Desktop. After a lot of search on GitHub issues, I am still not getting the solution.
This is what I found in my service.txt file (C:\ProgramData\DockerDesktop\service.txt)
[18:27:22.232][LoggingMessageHandler][Info ] [f9b6b957] <Server end> POST http://localhost/dns/refresh-hosts -> 204 NoContent (took 118ms)
I got this error when i un-installed the docker toolbox and installed the docker desktop.
System Configuration:
OS: Windows 10 Home
Version: 21H1
Steps I Followed:
Un-installed the docker desktop.
Removed the all dockers related environment variables from the user variables.
Navigation: This System-> Properties-> Advance System Settings-> Environment Variables-> User Variables.
Re-installed the docker desktop and it's started working properly.
Try to run it on Docker CLI instead of CMD
Open Powershell as Administrator and run the below commands
cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchDaemon
Docker for windows must have:
[✓] Updated Windows 10 version >=2004
[✓] WSL 2 and Default Distro (i.e ubuntu)
The steps are well documented here. These are what to do after the installation:
To confirm ubuntu's installation, open C:/Windows/System32/bash.exe aka bash.
To test if docker is properly installed, run docker version on bash. This should print the docker client and server engine.
After successfully tested and confirmed the installations, try entering your command
$ docker build -t heet1996/post:0.0.1 .
here we are talking about using Docker with PowerShell and not with WSL. And also following the addition of variables in the environment variables of Windows.
Configuration when this response was made:
Windows 10 Pro 20H2 (Build 19042.867)
Docker 20.10.5
Powershell 5.1.19041.610
I also had to configure docker in a dirty way too much, after several hours of research and a comparison of installation on a clean Windows 10 I understood where my error was.
In addition to the user environment variable also make sure that you do not have DOCKER variables in the Windows system environment variables either.
Here is where my error was, I think it was due to the installation of the Docker module
I had the DOCKER_HOST variable in my system variable environment, so i deleted it.
If you want to check all your environment variables with Powershell:
[System.Environment]::GetEnvironmentVariables()
If you really want a Docker fresh installation on Windows, you need to delete the following folders:
C:\ProgramData\Docker
C:\Program Files\Docker\Docker
$HOME\AppData\Local\Docker
$HOME\AppData\Roaming\Docker
$HOME\AppData\Roaming\Docker Desktop
$HOME\.docker
my error, therefore, produced this error:
ERROR ==> error during connect: Get http://docker.artofshell:2376/v1.24/version: dial tcp: lookup docker.artofshell: no such host
After a complete uninstall of all docker (Via chocolatey, official docker ...) and by properly installing Docker from the official executable here everything is back to normal
Then if you want to use docker via Powershell you have to change the configuration of DockerCLI as you can see on many answers
Conclusion
It is possible to use docker with Powershell you must check if the
server daemon is used by Windows/amd64, you can modify the daemon with this command cd "C:\Program Files\Docker\Docker"; .\DockerCli.exe -SwitchDeamon
You can check the configuration of the daemon with the following command: docker version
You must remove all traces of old Docker installations if you had any
You must delete the environment variables from the old installation or from the docker toolbox
You must also activate the experimental features: information here

docker-compose command not available for mac

I installed docker with the instructions here, downloading from docker-hub
https://docs.docker.com/docker-for-mac/install/
But when I run docker-compose I get this error
pyenv: docker-compose: command not found
The `docker-compose' command exists in these Python versions:
3.6.5/envs/myenv
Also, docker-compose is available under /Users
which docker-compose
/Users/<username>/.pyenv/shims/docker-compose
In this link says, docker-compose for mac need not be installed explicitly as it is part of docker for desktop mac.
https://docs.docker.com/compose/install/
Is something wrong with my installation?
I ran into the same issue on macOS today. Turned out that you need to run the installed app once, it does some additional downloading and setup. That setup includes setting up your path variables.
docker-compose is a utility that is now a parameter in mac docker
so instead of docker-compose up, its now docker compose up
if you install docker from official website then docker-compose will come along with that for mac so need to either upgrade and documentation is present there.

docker-compose is not working on Docker Beta for OS X

I'm using docker Version 1.11.1-beta11 (build: 6974) on OS X (which is native). It has a fancy migration tool to help you to move images from docker-machine to native docker (or something like that). Everything was working perfect, I even was able to start containers through docker-compose but then I rebooted my laptop and now docker-compose is not recognizing new docker engine I guess because I'm getting:
ERROR: Couldn't connect to Docker daemon - you might need to run `docker-machine start default`.
So I believe docker-compose still thinks I'm using or depending on docker-machine to start containers.
Any idea about how to workaround this issue?
Update:
Docker env variables:
DOCKER_TLS_VERIFY=1
DOCKER_HOST=tcp://192.168.99.100:2376
DOCKER_CERT_PATH=/Users/myuser/.docker/machine/machines/default
DOCKER_MACHINE_NAME=default
I removed the docker env variables from my rc script (~/.zshrc) and upgraded docker-compose version to 1.7.1. Also made sure sure docker-machine was down

Resources