七十三、容器安全-Docker运行环境检查

下载示例代码

  • 示例代码下载(flask + redis healthcheck) 本节源码

解压后创建.evn文件

[vagrant@swarm-manager ~]$ sudo unzip compose-healthcheck-redis.zip
Archive:  compose-healthcheck-redis.zip
   creating: compose-healthcheck-redis/
  inflating: compose-healthcheck-redis/.dockerignore
 extracting: compose-healthcheck-redis/.env
 extracting: compose-healthcheck-redis/.gitignore
  inflating: compose-healthcheck-redis/docker-compose.yml
   creating: compose-healthcheck-redis/flask/
  inflating: compose-healthcheck-redis/flask/app.py
  inflating: compose-healthcheck-redis/flask/Dockerfile
   creating: compose-healthcheck-redis/nginx/
  inflating: compose-healthcheck-redis/nginx/nginx.conf
  inflating: compose-healthcheck-redis/README.md
[vagrant@swarm-manager compose-healthcheck-redis]$ more .env
REDIS_PASSWORD=ABC123

构建镜像并启动

docker-compose pull
docker-compose up -d

Docker 配置扫描

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容