The docker compose will remain legacy volumes and couldn't now clear them
I tried to mount the current directory into container,
and changed its mounted name many times,
like crawler
-> data-crowler
-> ... root
However once I mount it, and it would remain in the container even I changed the mount volume name
What the interest is I've never use USER seluser
to do anything,
But you can see the folder's owner is seluser
How could that happened ?
end of Dockerfile
EXPOSE 4444
WORKDIR /lazy-bird
CMD ["/usr/bin/supervisord"]
docker-compose.yml
web:
build: .
volumes:
- .:/lazy-bird
Root directries
drwxrwxr-x 6 seluser seluser 4.0K Jun 10 02:39 crawler/
drwxrwxr-x 6 seluser seluser 4.0K Jun 10 02:39 data-crowler/
drwxrwxr-x 6 seluser seluser 4.0K Jun 10 02:39 lazy-bird/
drwxrwxr-x 6 seluser seluser 4.0K Jun 10 02:39 root/
Dockerfile
FROM selenium/node-firefox-debug
USER root
RUN apt-get update -qqy \
&& apt-get -qqy --no-install-recommends install \
firefox supervisor cron\
rsyslog \
&& rm -rf /var/lib/apt/lists/*
COPY config.json /opt/selenium/config.json
RUN apt-get update && apt-get -y upgrade && apt-get -y -qq --force-yes install \
build-essential \
tree \
ruby-dev \
vim \
git \
curl \
zsh \
sudo
# Install dependencies packages
RUN apt-get update && apt-get install -y \
build-essential \
openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev \
libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev \
autoconf libc6-dev ncurses-dev automake libtool bison nodejs
# Install Zsh
################## BEGIN INSTALLATION ######################
RUN git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh \
&& cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc \
&& chsh -s /bin/zsh
RUN sed -i -E "s/^plugins=\((.*)\)$/plugins=(\1 git git-flow ruby )/" ~/.zshrc
RUN echo "export TERM=vt100" >> /etc/zsh/zshrc
# bindkey to make HOME/END works on zsh shell
# set term=xtern make HOME/END works in vim
RUN echo "alias ls='ls --color=auto'" >> /etc/zsh/zshrc && \
echo "alias ll='ls -halF'" >> /etc/zsh/zshrc && \
echo "bindkey -v" >> /etc/zsh/zshrc && \
echo "bindkey '\eOH' beginning-of-line" >> /etc/zsh/zshrc && \
echo "bindkey '\eOF' end-of-line" >> /etc/zsh/zshrc && \
echo "alias ls='ls --color=auto'" >> /etc/profile &&\
echo "set term=xterm" >> ~/.vimrc
WORKDIR /tmp
COPY Gemfile Gemfile
RUN gem install bundler
RUN bundle install
#====================================
# Scripts to run cron job
#====================================
#ADD cron_lazy_bird /etc/crontab
RUN touch /var/log/cron.log
#====================================
# Scripts to run Selenium Standalone
#====================================
EXPOSE 4444
#USER root
# The following must match to docker-compose.yml or the container can not launch
WORKDIR /lazy-bird
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
CMD ["/usr/bin/supervisord"]
Entry_point.sh
#!/bin/bash
export GEOMETRY="$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH"
xvfb-run --server-args="$DISPLAY -screen 0 $GEOMETRY -ac +extension RANDR" \
java -jar /opt/selenium/selenium-server-standalone.jar \
-role node \
-hub http://$HUB_1_PORT_4444_TCP_ADDR:$HUB_1_PORT_4444_TCP_PORT/grid/register \
-browser browserName=firefox
--background
Answer one of your questions:
You need trace the whole steps in Dockerfiles with below way, then you should know when the image is involved with
USER seluser