尝试将clickhouse堆栈部署到docker swarm,出现错误:service builder未能生成:复制失败

uinbv5nw  于 2021-07-15  发布在  ClickHouse
关注(0)|答案(1)|浏览(467)

我在学习DockerSwarm的过程中,我有一个三节点的nuc设置,运行在Ubuntu16.04上的DockerSwarm。我希望使用以下官方图片构建一个2节点clickhouse群集:
https://hub.docker.com/r/yandex/clickhouse-server/dockerfile
我可以在一个节点上以映像的形式轻松地运行它,但我正在尝试将docker映像部署到其中的两个节点,以便使用以下文档从那里构建集群:
https://docs.docker.com/engine/swarm/stack-deploy/
但我在运行时遇到以下错误 docker-compose up -d :

ERROR: Service 'builder' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder795701575/docker_related_config.xml: no such file or directory

目录Map:

my_app
----docker-compose.yml
----docker
-------client
-------server
-------builder
            --Dockerfile

dockerfile文件:https://hub.docker.com/r/yandex/clickhouse-server/dockerfile

FROM ubuntu:18.04

ARG repository="deb http://repo.yandex.ru/clickhouse/deb/stable/ main/"
ARG version=19.1.13
ARG gosu_ver=1.10

RUN apt-get update \
    && apt-get install --yes --no-install-recommends \
        apt-transport-https \
        dirmngr \
        gnupg \
    && mkdir -p /etc/apt/sources.list.d \
    && apt-key adv --keyserver keyserver.ubuntu.com --recv E0C56BD4 \
    && echo $repository > /etc/apt/sources.list.d/clickhouse.list \
    && apt-get update \
    && env DEBIAN_FRONTEND=noninteractive \
        apt-get install --allow-unauthenticated --yes --no-install-recommends \
            clickhouse-common-static=$version \
            clickhouse-client=$version \
            clickhouse-server=$version \
            libgcc-7-dev \
            locales \
            tzdata \
            wget \
    && rm -rf \
        /var/lib/apt/lists/* \
        /var/cache/debconf \
        /tmp/* \
    && apt-get clean

ADD https://github.com/tianon/gosu/releases/download/1.10/gosu-amd64 /bin/gosu

RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

RUN mkdir /docker-entrypoint-initdb.d

COPY docker_related_config.xml /etc/clickhouse-server/config.d/
COPY entrypoint.sh /entrypoint.sh

RUN chmod +x \
    /entrypoint.sh \
    /bin/gosu

EXPOSE 9000 8123 9009
VOLUME /var/lib/clickhouse

ENV CLICKHOUSE_CONFIG /etc/clickhouse-server/config.xml

ENTRYPOINT ["/entrypoint.sh"]

docker-compose.yml公司https://github.com/yandex/clickhouse/blob/master/docker-compose.yml

version: "2"

services:
  builder:
    image: yandex/clickhouse-builder
    build: docker/builder
  client:
    image: yandex/clickhouse-client
    build: docker/client
    command: ['--host', 'server']
  server:
    image: yandex/clickhouse-server
    build: docker/server
    ports:
      - 8123:8123

我做得不对吗?谢谢你的帮助。
更新:
尝试注解解决方案,但不起作用:

ERROR: Service 'builder' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder511288209/docker_related_config.xml: no such file or directory
aiqt4smr

aiqt4smr1#

请查看此项目的github存储库,并尝试从中构建它:https://github.com/yandex/clickhouse/tree/master/docker/server
不要只是复制dockerfile,而是克隆项目并从那里构建它。

相关问题