dalenguyen / drupal8-docker

Docker for Local Drupal 8 Development
16 stars 13 forks source link

docker bash into server #1

Closed pasankg closed 5 years ago

pasankg commented 5 years ago

Hi, Can you please update the document on how to bash in to the server ?

CONTAINER ID        IMAGE                   COMMAND                  CREATED             STATUS              PORTS                  NAMES
018c6dc007f7        nginx:alpine            "nginx -g 'daemon of…"   8 minutes ago       Up 4 minutes        0.0.0.0:8080->80/tcp   drupal8_nginx
7af5abe5ffcb        drupal:8.6-fpm-alpine   "docker-php-entrypoi…"   8 minutes ago       Up 8 minutes        9000/tcp               drupal8_drupal
a33a82d4194b        mysql:8                 "/entrypoint.sh --de…"   8 minutes ago       Up 8 minutes        3306/tcp, 33060/tcp    drupal8_mysql

I get below errors when trying;

$docker exec drupal8_drupal bash
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"bash\": executable file not found in $PATH": unknown
$docker exec drupal8_nginx bash
OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"bash\": executable file not found in $PATH": unknown

Thanks

dalenguyen commented 5 years ago

Hi @pasankg, can you try

docker exec drupal8_drupal /bin/bash

or

docker exec drupal8_drupal sh
docker exec drupal8_drupal /bin/sh
pasankg commented 5 years ago

Hi @dalenguyen Thank you for your reply. I tried the commands as you said but doesn't seems to work.

Screen Shot 2019-09-19 at 10 00 54 am

dalenguyen commented 5 years ago

@pasankg sorry, you need to add -ti to the command

docker exec -ti drupal8_drupal /bin/sh
pasankg commented 5 years ago

Thanks @dalenguyen that worked. It doesn't seem to allow composer or drush commands in there. Is there a way to resolve it too ? Thanks again

dalenguyen commented 5 years ago

@pasankg moved to #2.