docker运行testlink1.9.20

it2026-04-16  2

导语:公司装有testlink的windows虚拟机经常莫名其妙断网 需要手动去连接。黄色!的那种 没网状态。打算放到linux里,数据也放到相对安全的位置,面的虚拟机挂了都挂了。先docker启动一下 测试,后续考虑扔到k8s里。
导入镜像
docker load < bitnami_mariadb_latest.tar.gz docker load < bitnami_testlink_latest.tar.gz # 镜像下载地址 链接: https://pan.baidu.com/s/1Agfjxyvn6N03ZecM9Yo0Ng 密码: qt2f --来自百度网盘超级会员V4的分享

按照以下步骤 参考官网 仅多安装一个nginx

Step 1: Create a network
$ docker network create testlink-network
Step 2: Create a volume for MariaDB persistence and create a MariaDB container
$ docker volume create --name mariadb_data $ docker run -d --name mariadb \ --env ALLOW_EMPTY_PASSWORD=yes \ --env MARIADB_USER=bn_testlink \ --env MARIADB_PASSWORD=bitnami \ --env MARIADB_DATABASE=bitnami_testlink \ --network testlink-network \ --volume mariadb_data:/bitnami/mariadb \ bitnami/mariadb:latest
Step 3: Create volumes for TestLink persistence and launch the container
$ docker volume create --name testlink_data $ docker run -d --name testlink \ -p 8080:8080 -p 8443:8443 \ --env ALLOW_EMPTY_PASSWORD=yes \ --env TESTLINK_DATABASE_USER=bn_testlink \ --env TESTLINK_DATABASE_PASSWORD=bitnami \ --env TESTLINK_DATABASE_NAME=bitnami_testlink \ --network testlink-network \ --volume testlink_data:/bitnami/testlink \ bitnami/testlink:latest

可以看到curl localhost:8080是有返回的

Step 4: 虚拟机安装nginx
yum -y install nginx # 并转发80到localhost:8080 cat > /etc/nginx/nginx.conf |grep -v '#' |grep -v '^$' <<EOF user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { log_format main '\$remote_addr - \$remote_user [\$time_local] "\$request" ' '\$status $body_bytes_sent "\$http_referer" ' '"\$http_user_agent" "\$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; include /etc/nginx/conf.d/*.conf; server { listen 80; server_name 192.168.1.133; # 这里写自己的ip location / { proxy_set_header HOST \$host; proxy_set_header X-Real-IP \$remote_addr; proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; proxy_pass http://localhost:8080; } } } EOF # nginx -t 如果报错 根据报错修改配置文件 nginx -t # 运行nginx nginx netstat -luntp |grep 80
Step 5: Access your application at http://your-ip/
用户名:user 密码:bitnami

效果图

参考官网 https://hub.docker.com/r/bitnami/testlink

最新回复(0)