I have written a Dockerfile which uses as an image an private adapted Alpine image, which contains a nginx server.
Note: Alpine uses sh
, not Bash.
I love to have some shell aliases available, when working in the container and it drives me nuts when they are missing. So I copy a small prepared file to /root/.profile, which works. I can view the file and its contents. But the file does not load automatically; only if I manually do . ~/.profile
in the container then I have the aliases available.
What do I have to do, that my profile is automatically loaded after I started the container and connect into its shell?
FROM myprivatealpineimage/base-image-php:7.4.13
ARG TIMEZONE
COPY ./docker/shared/bashrc /root/.profile
COPY ./docker/shared/ /tmp/scripts/
RUN chmod +x -R /tmp/scripts/ \
&& /tmp/scripts/set_timezone.sh ${TIMEZONE}\
&& apk update\
&& apk add --no-cache git
RUN install-ext pecl/apcu pecl/imagick pecl/zip pecl/redis
RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing gnu-libiconv
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
WORKDIR /var/www
PATH
inDockerfile
and call the scripts in that path by name. – Sewing