Ubuntu系统上docker 内启动图形界面程序报错Authorization required, but no authorization protocol specified

文章讲述了在Linux中遇到的环境变量问题(DISPLAY和XAUTHORITY),如何通过为新用户yeqiang设置环境变量并重试gnome-calculator以解决显示和权限问题,以及处理TLS证书警告的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

错误

root@9f6d6dcabc3f:/# env | grep DIS
DISPLAY=:1
root@9f6d6dcabc3f:/# env | grep XAU
XAUTHORITY=/home/yeqiang/.Xauthority
root@9f6d6dcabc3f:/# ll /home/yeqiang/.Xauthority 
-rw------- 1 1000 1000 61 Oct 12 08:08 /home/yeqiang/.Xauthority
 

解决过程,采用yeqiang启动

root@9f6d6dcabc3f:/# useradd yeqiang
root@9f6d6dcabc3f:/# ll /home/yeqiang/.Xauthority 
-rw------- 1 yeqiang yeqiang 61 Oct 12 08:08 /home/yeqiang/.Xauthority
root@9f6d6dcabc3f:/# su yeqiang
$ export DISPLAY=:1
$ export XAUTHORITY=/home/yeqiang/.Xauthority
$ gnome-calculator

(gnome-calculator:4776): dbind-WARNING **: 07:26:47.417: Couldn't connect to accessibility bus: Failed to connect to socket /run/user/1000/at-spi/bus_1: No such file or directory
Gtk-Message: 07:26:47.433: Failed to load module "canberra-gtk-module"
Gtk-Message: 07:26:47.434: Failed to load module "canberra-gtk-module"

** (gnome-calculator:4776): WARNING **: 07:26:47.954: currency-provider.vala:161: Couldn't download IMF currency rate file: Unacceptable TLS certificate

** (gnome-calculator:4776): WARNING **: 07:26:49.649: currency-provider.vala:161: Couldn't download ECB currency rate file: Unacceptable TLS certificate
 

Sure! I can help you with that. Here is an example of a Docker Compose configuration for setting up ONLYOFFICE Workspace: ```yaml version: '3' services: onlyoffice: image: onlyoffice/workspace:latest restart: always ports: - 80:80 - 443:443 environment: - JWT_ENABLED=true - JWT_SECRET=your_jwt_secret - JWT_HEADER=Authorization - CORS_ALLOWED_ORIGINS=* volumes: - ./data:/var/www/onlyoffice/Data - ./logs:/var/log/onlyoffice - ./certs:/var/www/onlyoffice/Data/certs onlyoffice-mysql: image: mysql:5.7 restart: always environment: - MYSQL_ROOT_PASSWORD=your_mysql_root_password - MYSQL_DATABASE=onlyoffice - MYSQL_USER=onlyoffice - MYSQL_PASSWORD=your_mysql_password volumes: - ./mysql:/var/lib/mysql onlyoffice-redis: image: redis:latest restart: always volumes: - ./redis:/data onlyoffice-rabbitmq: image: rabbitmq:3 restart: always volumes: - ./rabbitmq:/var/lib/rabbitmq ``` Make sure to replace the placeholder values with your own configuration. This example sets up ONLYOFFICE Workspace with MySQL, Redis, and RabbitMQ as the required dependencies. To run ONLYOFFICE Workspace using Docker Compose, create a new directory and save the above configuration in a file named `docker-compose.yml`. Then, open a terminal, navigate to the directory containing the file, and run the following command: ``` docker-compose up -d ``` This will start the ONLYOFFICE Workspace containers in the background. You can access ONLYOFFICE Workspace by opening a web browser and entering `http://localhost` or `https://localhost` in the address bar. Remember to adjust any firewall or network settings to allow incoming connections to the specified ports (80 and 443 in this example) if necessary. I hope this helps! Let me know if you have any further questions.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值