简体   繁体   English

如何使用命令行使用凭证连接到Docker容器?

[英]How to connect to a Docker container with credentials using command line?

I've pulled a database image using docker and set the needed database url and credentials in my context.xml file. 我已经使用docker拉出了一个数据库映像,并在我的context.xml文件中设置了所需的数据库URL和凭据。 However, I get an access denied error when starting Tomcat. 但是,启动Tomcat时出现访问拒绝错误。 So I would like to connect to this Docker container with the help of cmd. 所以我想在cmd的帮助下连接到这个Docker容器。

We suppose that your container is running. 我们假设您的容器正在运行。 So, use : 因此,使用:

docker exec -t -i CONTAINER_NAME /bin/sh

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM