forked from temporalio/docker-builds
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase-admin-tools.Dockerfile
More file actions
45 lines (37 loc) · 1.17 KB
/
base-admin-tools.Dockerfile
File metadata and controls
45 lines (37 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
ARG BASE_IMAGE=alpine:3.23.3
FROM ${BASE_IMAGE} AS builder
# These are necessary to install cqlsh
RUN apk add --update --no-cache \
python3-dev \
musl-dev \
libev-dev \
gcc \
g++ \
pipx
# cassandra-driver source builds still import pkg_resources via ez_setup.
# Setuptools v82 removed pkg_resources: https://setuptools.pypa.io/en/latest/history.html#v82-0-0
# On Alpine, cassandra-driver is built from source (no musllinux wheels), so pip's isolated
# build env must be constrained to setuptools<81 or the build fails.
RUN printf 'setuptools<81\n' > /tmp/pip-build-constraints.txt && \
PIP_CONSTRAINT=/tmp/pip-build-constraints.txt pipx install --global cqlsh && \
rm -f /tmp/pip-build-constraints.txt
FROM ${BASE_IMAGE} AS base-admin-tools
RUN apk upgrade --no-cache
RUN apk add --no-cache \
python3 \
libev \
ca-certificates \
tzdata \
bash \
curl \
jq \
yq \
mysql-client \
postgresql-client \
expat \
tini
COPY --from=builder /opt/pipx/venvs/cqlsh /opt/pipx/venvs/cqlsh
RUN ln -s /opt/pipx/venvs/cqlsh/bin/cqlsh /usr/local/bin/cqlsh
# validate cqlsh installation
RUN cqlsh --version
SHELL ["/bin/bash", "-c"]