Here's my Dockerfile:
FROM php:7.0-apacheI do docker exec -it <hash> bash from the CLI and then do mysql and get a bash: mysql: command not found error.
I do apt-get install mysql and the package can't be located. I get the same error when I try to install mysql-client and mysql-server.
If I want to install mysql in Ubuntu mysql-client does the trick.
2 Answers
You have to customize your Dockerfile to install the mysql client on your image.
You should have to add something like after the FROM :
RUN apt-get update && apt-get install -y mysql-client && rm -rf /var/lib/aptand of course rebuild your image.
1my docker image: debian:stable-20200720-slim
mysql-clinet didn't work for me. after adding contrib and non-free to source.list execute this command:
apt-get update && apt install mariadb-clientthen client works just fine.
1