Docker
無法進入 docker 容器的 bash:hydra 容器正在重新啟動
使用本文件:
- 我已經提取了
vimagick/hydra
docker 鏡像docker-compose.yml
在文件夾中創建文件~/Soft/docker/
:hydra: image: vimagick/hydra command: sleep infinity volumes: - ./data:/data working_dir: /data restart: unless-stopped
- 已安裝
docker-compose
- 執行:
docker-compose up -d Starting docker_hydra_1 ... done
- 執行:
docker-compose exec hydra bash Error response from daemon: Container ecf710f3f9526cf598c4a15a485fbfc3790a36e5f8b989820a157ba5453fc24f is restarting, wait until the container is running
docker ps
給出:CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ecf710f3f952 vimagick/hydra "bash sleep infinity" 20 hours ago Restarting (126) 20 seconds ago docker_hydra_1 93b5c43c6952 vulnerables/web-dvwa "/main.sh" 39 hours ago Up 23 minutes 0.0.0.0:80->80/tcp dvwatest $ docker exec -it ecf bash Error response from daemon: Container ecf710f3f9526cf598c4a15a485fbfc3790a36e5f8b989820a157ba5453fc24f is restarting, wait until the container is running
我看到該
docker-compose.yml
文件包含restart: unless-stopped
記錄。但是為什麼會這樣記錄以及當我無法連接到它時如何使用這個容器?謝謝!
編輯您
docker-compose.yml
的如下:hydra: image: vimagick/hydra entrypoint: sleep command: infinity volumes: - ./data:/data working_dir: /data restart: unless-stopped