背景
为什么需要自己安装?而不是直接使用已有的镜像?
因为现用镜像不具有业务程序运行环境,所以只能基于Dockerfile从新构建业务运行环境底包(基础镜像);
思路
1.源码编译,获得clickhouse-client,Dockefiel构建新镜像;
2.获取具有clickhouse-client镜像,取出clickhouse-client,通过Dockefiel构建到需要得新镜像;
获取镜像
docker pull yandex/clickhouse-client
注意:其他
更多
版本查看HUB官网,搜索“
clickhouse-client
运行镜像
docker run -it --rm --name clickhouse-client --entrypoint /bin/bash yandex/clickhouse-client:latest
复制程序
docker cp clickhouse-client:/usr/bin/clickhouse .
注意:clickhouse-client命令是软连接/usr/bin/clickhouse,所以只需要复制clickhouse即可;
编写Dockerfile文件
FROM xxxxxxx:1.0
LABEL Embedded clickhouse-client command
COPY clickhouse /usr/bin
RUN ln -s /usr/bin/clickhouse /usr/bin/clickhouse-client
构建镜像
特别声明:以上内容(如有图片或视频亦包括在内)为自媒体平台“网易号”用户上传并发布,本平台仅提供信息存储服务。
Notice: The content above (including the pictures and videos if any) is uploaded and posted by a user of NetEase Hao, which is a social media platform and only provides information storage services.