Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
281382c0
G
glances
项目概览
蜕变的菜鸟
/
glances
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
glances
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
281382c0
编写于
5月 14, 2021
作者:
M
Markus Pöschl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Migrate the dev image also in the multi-stage build
上级
781c9961
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
38 addition
and
43 deletion
+38
-43
docker-files/README.md
docker-files/README.md
+20
-0
docker-files/debian.Dockerfile
docker-files/debian.Dockerfile
+18
-4
docker-files/dev.Dockerfile
docker-files/dev.Dockerfile
+0
-39
未找到文件。
docker-files/README.md
0 → 100644
浏览文件 @
281382c0
# Dockerfiles
The Dockerfiles used here are using multi-staged builds.
For building a specific stage locally docker needs to know the target stage with
`--target`
.
## Examples
For the dev image:
``bash
docker build --target dev -f docker-files/debian.Dockerfile -t glances .
``
For the minimal image:
``bash
docker build --target minimal -f docker-files/debian.Dockerfile -t glances .
``
For the full image:
``bash
docker build --target full -f docker-files/debian.Dockerfile -t glances .
``
docker-files/debian.Dockerfile
浏览文件 @
281382c0
...
...
@@ -18,10 +18,13 @@ RUN apt-get update && \
iputils-ping
&&
\
apt-get clean
&&
rm
-rf
/var/lib/apt/lists/
*
FROM
build as remoteInstall
# Force rebuild otherwise it could be cached without rerun
ARG
VCS_REF
RUN
pip3
install
--no-cache-dir
--user
glances[all]
FROM
build as additional-packages
COPY
*requirements.txt .
...
...
@@ -29,7 +32,19 @@ COPY *requirements.txt .
RUN
CASS_DRIVER_NO_CYTHON
=
1 pip3
install
--no-cache-dir
--user
-r
optional-requirements.txt
#Create running image without any building dependency
FROM
build as dev
COPY
. /glances
COPY
--from=additional-packages /root/.local/lib/python3.9/site-packages /usr/lib/python3.9/site-packages/
# EXPOSE PORT (XMLRPC / WebUI)
EXPOSE
61209 61208
# Define default command.
CMD
python3 -m glances -C /glances/conf/glances.conf $GLANCES_OPT
#Create running images without any building dependency
FROM
${ARCH}python:3.9-slim-buster as minimal
RUN
apt-get update
&&
\
...
...
@@ -40,8 +55,8 @@ RUN apt-get update && \
iputils-ping
&&
\
apt-get clean
&&
rm
-rf
/var/lib/apt/lists/
*
COPY
--from=
build
/root/.local/bin /usr/local/bin/
COPY
--from=
build
/root/.local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages/
COPY
--from=
remoteInstall
/root/.local/bin /usr/local/bin/
COPY
--from=
remoteInstall
/root/.local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages/
# EXPOSE PORT (XMLRPC / WebUI)
EXPOSE
61209 61208
...
...
@@ -53,4 +68,3 @@ CMD python3 -m glances -C /glances/conf/glances.conf $GLANCES_OPT
FROM
minimal as full
COPY
--from=additional-packages /root/.local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages/
docker-files/dev.Dockerfile
已删除
100644 → 0
浏览文件 @
781c9961
#
# Glances Dockerfile (based on Ubuntu)
#
# https://github.com/nicolargo/glances
#
ARG
ARCH=
FROM
${ARCH}python:3-buster
# Install package
# Must used calibre package to be able to run external module
ENV
DEBIAN_FRONTEND noninteractive
RUN
\
apt-get update
&&
\
apt-get
install
-y
\
curl
\
gcc
\
git
\
lm-sensors
\
wireless-tools
\
iputils-ping
&&
\
rm
-rf
/var/lib/apt/lists/
*
RUN
pip
install
psutil bottle
# Define working directory
WORKDIR
/glances
COPY
*requirements.txt .
RUN
CASS_DRIVER_NO_CYTHON
=
1 pip
install
-r
optional-requirements.txt
COPY
. /glances
# EXPOSE PORT (XMLRPC / WebUI)
EXPOSE
61209 61208
# Define default command.
CMD
python3 -m glances -C /glances/conf/glances.conf $GLANCES_OPT
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录