Yevgen
Yevgen

Reputation: 1300

Building your own docker images of SeleniumHQ/docker-selenium

I'm not sure if it is a bug or just me being stupid but here is the case.

I want to build my image based on StandaloneChromeDebug. Following the Wiki:

  1. Pull the repo.

  2. Generate image:

$ make standalone_chrome_debug
  1. Build the Dockerfile to insure that no errors arise:
$ docker build --no-cache etc/docker-selenium/StandaloneChromeDebug/
  1. Set up my image to the docker-compose.yml like:
selenium-hub:
        container_name: selenium-hub
        build: ./etc/docker-selenium/StandaloneChromeDebug/
        volumes:
            - /dev/shm:/dev/shm
        ports:
            - "4444:4444"
            - "5900:5900"
        environment:
           - HUB_HOST=selenium-hub
           - HUB_PORT=4444

And... nothing. The container is running (no errros) but Selenium doesn't work, container log is empty, /opt/ folder is empty. What am i doing wrong? How to debug the thing?

Upvotes: 6

Views: 1464

Answers (2)

Sers
Sers

Reputation: 12255

Path is wrong, use build: /etc/docker-selenium/StandaloneChromeDebug/ without .
If you try to cd to ./etc/docker-selenium/StandaloneChromeDebug/, you will get an error.

version: "3.5"
services:
   selenium-hub:
        container_name: selenium-hub
        build: /etc/docker-selenium/StandaloneChromeDebug/
        volumes:
            - /dev/shm:/dev/shm
        ports:
            - "4444:4444"
            - "5900:5900"
        environment:
           - HUB_HOST=selenium-hub
           - HUB_PORT=4444

Exapmle: enter image description here

Upvotes: 3

sxm1972
sxm1972

Reputation: 752

I feel you are using "build" tag in your compose file rather than "image". Please use "image" tag instead and see if that runs your image correctly.

Also can you please show how you are launching your docker services and what the output is?

Reference to build command

Upvotes: -1

Related Questions