'Use apache's autocomplete in a simple Docker LAMP setup
I recently have switched to using Docker instead of Vagrant, and am a bit confused if I have configured it correctly or even if I am using it correctly.
I have created a simple LAMP structure with a seperate container for PHP, phpMyAdmin & MySql. Everything is working quite well, accept when I open the CLI of my PHP/MySql container no typehinting is available. Simple commands as using the tab to complete a matching filename, or using the up/down arrows to browse through old commands is not working.
I understand why it is not working; this is an apache-functionality and we are now in a container with isolated PHP or Mysql functionalities. But I think these are quite convenient, maybe even important, functionalities to have.
What would be the best practice to have these simple functionalities available inside the PHP or Mysql container?
Thanks, Pieter
Solution 1:[1]
You can do it simply with using:
docker ps
This commands will get you the <container_id> for exemple:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
475c2c626a97 prestashop/prestashop:1.7-7.3-fpm "docker-php-entrypoi…" 3 minutes ago Up 3 minutes 0.0.0.0:9000->9000/tcp, 0.0.0.0:8100->80/tcp prestashop-test
If for exemple i want to go into prestashop container with bash i'll use this command:
docker exec -it 475c2c626a97 bash
And here you will have all the bash shortcuts
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Zemmouri Tarek |
