markshust / docker-magento

Mark Shust's Docker Configuration for Magento
https://m.academy/courses/set-up-magento-2-development-environment-docker/
MIT License
2.45k stars 981 forks source link

SSH Docker Image has issues #1148

Open sdouma opened 2 months ago

sdouma commented 2 months ago

Description I started a new docker magento(fresh images) and every time I would get an error saying an fpm instance was already started and I could not connect via ssh. I noticed that /usr/sbin/sshd didn't exist. After creating the dockerfile and building the image locally, it worked. I noticed on dockerhub that the digest shows a process to add php 8.2 but I didn't anything particular to set up ssh.

Steps To Reproduce

  1. Go through steps for an existing project

Expected Result I can start my containers and ssh

Actual Result I can't do those things and I can't even run basic commands like apt-get.

Franz-Budon-Bapt commented 1 month ago

I have same issue. It's possible that the following commands in the docker-magento dockerfile are not running correctly and so the image is corrupted : apt-get update && apt-get install -y ssh

When i do those commands manually inside the container, I get this :

docker exec -it magento-ssh-1 apt-get update && apt-get install -y ssh Reading package lists... Done E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)

The issue is that for an unknown reason the root user is not by default in the FROM image debian:buster-slim.

With the following command that enforces the user as root, i was able to install the ssh daemon, which proves it was not installed in the first place : docker exec -it --user root magento-ssh-1 apt-get install -y ssh