There is my Dockerfile
:
# https://hub.docker.com/_/php/
FROM php:5.5.23-fpm
USER www-data
ADD .bash_profile /var/www/.bash_profile
SHELL ["/bin/bash", "-c"]
RUN source /var/www/.bash_profile
Then after container built I run docker exec -it CONTAINER_NAME bash
I did not see my aliases defined into /var/www/.bash_profile
. But if I execute source /var/www/.bash_profile
manually – everything is ok.
The same problem described here: https://github.com/docker/kitematic/issues/896 but no answer.
Had a similar issue and the easiest solution was to use the -l option to bash to make bash act as if it had been invoked as a login shell.
docker run --rm -it $IMAGE /bin/bash -l
bash will then read in ~/.bash_profile
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With