1. Home
  2. Knowledge Base
  3. ClickHouse DBA
  4. How To Install ClickHouse And Python In The Same Docker Container

How To Install ClickHouse And Python In The Same Docker Container

If you want to install Python by default in the container where ClickHouse is running, you can easily deploy a container containing ClickHouse and Python by following the steps below.

github link:

git clone https://github.com/ChistaDATA/Python-ClickHouse-Container-Build

Prepare DockerFile

 

vi dockerfile

Copy and paste the following command into the dockerfile. This file will install the latest version of ClickHouse and Python.

 

FROM python:3

RUN python3 -m venv /venv
ENV PATH="/venv/bin:$PATH"
RUN pip install -U pip
RUN apt update -y
RUN apt install vim -y
RUN apt install sudo -y
RUN apt-get install -y apt-transport-https ca-certificates dirmngr
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 8919F6BD2B48D754
RUN echo "deb https://packages.clickhouse.com/deb stable main" | tee /etc/apt/sources.list.d/clickhouse.list
RUN apt-get update
RUN apt-get install debconf -y
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get -qq install clickhouse-server clickhouse-client
RUN sudo service clickhouse-server start

 

Build and Run Image

 

Run the following commands to deploy the container

 

docker build -t dockerfile .
docker run -t dockerfile

 

 

Was this article helpful?

Related Articles

CHISTADATA IS COMMITTED TO OPEN SOURCE SOFTWARE AND BUILDING HIGH PERFORMANCE COLUMNSTORES

In the spirit of freedom, independence and innovation. ChistaDATA Corporation is not affiliated with ClickHouse Corporation 

Need Support?

Can't find the answer you're looking for?
Contact Support

ChistaDATA Inc. Knowledge base is licensed under the Apache License, Version 2.0 (the “License”)

Copyright 2022 ChistaDATA Inc

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.