Root password inside a Docker container

You can log into the Docker container using the root user (ID = 0) instead of the provided default user when you use the -u option. E.g. docker exec -u 0 -it mycontainer bash root (id = 0) is the default user within a container. The image developer can create additional users. Those users are … Read more

Copying files from Docker container to host

In order to copy a file from a container to the host, you can use the command docker cp <containerId>:/file/path/within/container /host/path/target Here’s an example: $ sudo docker cp goofy_roentgen:/out_read.jpg . Here goofy_roentgen is the container name I got from the following command: $ sudo docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1b4ad9311e93 … Read more

org.openqa.selenium.NoSuchSessionException: Unable to find session with ID error testing with Behat/Mink and Selenium2Driver in docker container

This error message… org.openqa.selenium.NoSuchSessionException: Unable to find session with ID: url\n Build info: version: ‘4.0.0-alpha-6’, revision: ‘5f43a29cfc’\n System info: host: ‘fca78c7f81e6’, ip: ‘172.28.0.3’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘5.4.0-42-generic’, java.version: ‘1.8.0_252’\n Driver info: driver.version: unknown …implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session which gets reflected in … Read more

Build a single image based on docker compose containers

This is not recommended at all. You will need to reverse engineer each image and copy the needed binaries/files into the combined image. The approach for that is to use docker multistage build: FROM apexits/ubuntu-oracle-jdk8-tomcat9 as tomcat FROM mysql:5.6.36 as mysql FROM elasticsearch:2.3.4 COPY –from=tomcat /…/tomcat-installtion …/tomcat-installation COPY –from=mysql /…/mysql-installtion …/mysql-installation … This approach is … Read more