on remote server, docker running image based off nginx
dockerfile
from nginx copy ./ /usr/share/nginx/html expose 80 cmd /usr/sbin/nginx -g "daemon off;"
docker ps
shows:
container id image command created status ports names a71e45d5cd40 myusername/mynginxwebsite:latest "\"/bin/sh -c '/usr/ 23 hours ago 23 hours 80/tcp, 443/tcp sharp_fermi
after connecting remote server via ssh, running docker attach <container_id>
shows output of nginx
, pressing ctrl
+q
, ctrl
+c
, ctrl
+p
not me bash shell.
is possible shell? i'll git pull
.
docker exec -it <container-id-or-name> /bin/bash
as per https://docs.docker.com/reference/commandline/cli/#exec -
usage: docker exec [options] container command [arg...]
run command in running container
-d, --detach=false detached mode: run command in background -i, --interactive=false keep stdin open if not attached -t, --tty=false allocate pseudo-tty