Install TestLink Inside Docker Container in Linux

Install TestLink Inside Docker Container in Linux

TestLink is a web-based test management system for quality assurance teams. TestLink is an open-source project licensed under the GPL.

This tutorial explains how to install TestLink inside a Docker container in the Linux. Commands have been tested on Ubuntu.

Prepare environment

Make sure you have installed Docker in your system. If you are using Ubuntu, installation instructions can be found in the post.

You also need to have a running MySQL container. Instructions can be found in the post.

Install TestLink

Before starting, create testlink database:

docker exec -it mysql mysql -u root -p -e "CREATE DATABASE testlink"

Create directory for data:

sudo mkdir -p /opt/testlink/data

Set user, which ID is 1001 as owner for newly created directory:

sudo chown -R 1001:1001 /opt/testlink

Note: it doesn't matter that user (ID: 1001) doesn't exist on host system. This user will be created in the container.

  • Host network

Run the following command to create a container for TestLink that uses host network:

docker run -d --name=testlink --restart=always --network=host \
    -v /opt/testlink/data:/bitnami \
    -e TESTLINK_USERNAME=admin \
    -e TESTLINK_PASSWORD=pwd123 \
    -e TESTLINK_DATABASE_USER=root \
    -e TESTLINK_DATABASE_PASSWORD=pwd123 \
    -e TESTLINK_DATABASE_NAME=testlink \
    -e TESTLINK_DATABASE_HOST=127.0.0.1 \
    bitnami/testlink-archived
  • User-defined bridge network

User-defined bridge network can be used for listening on different port. By default, TestLink service is listening on port 8080. It can be changed with -p option.

docker network create app-net
docker run -d --name=testlink --restart=always --network=app-net \
    -p 8081:8080 \
    -v /opt/testlink/data:/bitnami \
    -e TESTLINK_USERNAME=admin \
    -e TESTLINK_PASSWORD=pwd123 \
    -e TESTLINK_DATABASE_USER=root \
    -e TESTLINK_DATABASE_PASSWORD=pwd123 \
    -e TESTLINK_DATABASE_NAME=testlink \
    -e TESTLINK_DATABASE_HOST=mysql \
    bitnami/testlink-archived

Notes:

  • Don't forget to change admin password for TestLink using TESTLINK_PASSWORD.
  • The TESTLINK_DATABASE_USER and TESTLINK_DATABASE_PASSWORD can be used to specify MySQL credentials.
  • When user-defined bridge network is used, don't forget to change TESTLINK_DATABASE_HOST. It specifies MySQL container name.

Testing TestLink

Open a web browser and go to http://<IP_ADDRESS>:8080, where <IP_ADDRESS> is the IP address of the system. Log in to the dashboard with the admin username and password.

TestLink Inside Docker Container in Linux

Uninstall TestLink

To completely remove TestLink, remove its container:

docker rm --force testlink

Remove TestLink image:

docker rmi bitnami/testlink-archived

You can also remove TestLink data:

sudo rm -rf /opt/testlink

If a user-defined bridge network was created, you can delete it as follows:

docker network rm app-net

Leave a Comment

Cancel reply

Your email address will not be published.