上下文 我一直在PhantomJS,Google Chrome和Firefox本地運行我的Karma測試,沒有任何問題。目前,我正在運行Docker中的Karma測試,並且在Docker容器內的Firefox中運行Karma測試時遇到了問題,儘管Docker容器可以在Google Chrome中運行Karma測試而不會出現任何問題。在Docker中打開Karma服務器URL後,Firefox掛起
問題 當我創建了一個包含谷歌Chrome,火狐,JS庫(節點,NPM,咕嚕...等),以及VNC公用事業(Xvfb來,x11vnc)碼頭工人的容器。我啓動了VNC服務器並運行測試。 Firefox已啓動,套接字使用唯一的ID創建。當我進入VNC會話時,我可以看到firefox已啓動,URL已加載到URL欄,並且加載了Karma頁面。但是,大約2秒後,網頁將凍結,Firefox被掛起。因此我也看不到LOG: 'INFO[2015-10-16 20:19:15]: Router Started'
消息。
有趣的發現,而複製本手動 我已經累了評論the lines that starts Firefox,所以當我跑噶測試,纔會開始善緣服務器。然後我試着用以下2種方法進行的測試 -
- 通過
docker exec -it <container_tag>
啓動bash命令,執行firefox
,並與試運行的對應ID輸入服務器URL。在這種情況下,Firefox並未掛起,然後開始測試運行。 - 通過
docker exec -it <container_tag>
開始Bash會話,執行firefox <server_url_with_coresponding_id>
。在這種情況下,Firefox並未掛起,然後開始測試運行。
我DockerFile 從Ubuntu的:14.04
#========================
# Environment Variables for Configuration
#========================
ENV GEOMETRY 1920x1080x24
ENV DISPLAY :0
#========================
# Install Required Packages
#========================
RUN apt-get update -qq && apt-get install -qqy wget \
wget \
firefox \
xvfb \
x11vnc \
nodejs \
npm
#========================
# Install Google Chrome (Latest Stable Version)
#========================
RUN \
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list && \
apt-get update -qq && \
apt-get install -qqy google-chrome-stable
#========================
# Clean up Apt
#========================
RUN \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
#========================
# Setup VNC Server
#========================
RUN \
mkdir -p ~/.vnc && \
x11vnc -storepasswd 1234 ~/.vnc/passwd
#========================
# Symlink NodeJS
#========================
RUN ln -s /usr/bin/nodejs /usr/bin/node
#========================
# Install Grunt and Grunt-CLI
#========================
RUN \
npm install -g grunt && \
npm install -g grunt-cli
#========================
# Setup Entry Point
#========================
COPY entry_point.sh /opt/bin/entry_point.sh
RUN chmod +x /opt/bin/entry_point.sh
ENTRYPOINT ["/opt/bin/entry_point.sh"]
我認爲,這是與卡瑪 - 火狐 - 發射器或因緣主要圖書館的一個問題。如果有人能給我一些指點和想法,那會很棒!
您缺少在您的Docker容器中安裝的東西,如何找到它是另一個問題 – user2915097
我已經發布了我的DockerFile。你能看看我是否錯過了任何東西嗎? – thinket