简体   繁体   English

如何在 Ubuntu 19.10 引导上启动 docker 容器?

[英]How to start a docker container on Ubuntu 19.10 boot?

How to configure my system to start automatically a docker container on boot?如何配置我的系统以在启动时自动启动 docker 容器?

I'm using a local docker container to access database.我正在使用本地 docker 容器来访问数据库。 Always that i restart my system, i need start manually the container with the command docker start container_name .总是我重新启动我的系统,我需要使用命令docker start container_name手动启动容器。

To resolve it, i added the script at Startup Applications.为了解决它,我在启动应用程序中添加了脚本。

I followed the bellow steps:我按照以下步骤操作:

  1. Open the Startup Applications with command gnome-sessions-properties ;使用命令gnome-sessions-properties打开启动应用程序;
  2. Add the command docker start container_name .添加命令docker start container_name

Done.完毕。 Always on boot the container will be started.始终在启动时将启动容器。

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

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