forked from nutanix/calm-dsl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (33 loc) · 1.15 KB
/
Dockerfile
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
FROM python:3.7-alpine
# Upgrade to latest pip and install setuptools
RUN pip3 install --no-cache-dir --upgrade pip setuptools
# Create user site-package directory
WORKDIR /root
RUN mkdir -p `python3 -m site --user-site`
ENV PATH=/root/.local/bin:$PATH
# Alpine is not manylinux compatible, so any package containing C extensions
# must be built from source [PEP 513].
# Add build packages needed to compile from source
ENV BUILD_PACKAGES="\
build-base \
openssl-dev \
libxml2-dev \
jpeg-dev \
"
# Install build packages for building from source
RUN apk update && apk add --no-cache $BUILD_PACKAGES
# Install calm.dsl requirements
COPY requirements.txt /requirements.txt
RUN pip3 install --no-cache-dir -r /requirements.txt --user && rm /requirements.txt
# Remove build packages
RUN apk del $BUILD_PACKAGES
# Install calm.dsl
COPY dist/calm.dsl*.whl .
RUN pip3 install --no-cache-dir calm.dsl*.whl --user && rm calm.dsl*.whl
# Install bash and auto-completion for calm commands
RUN apk add --no-cache bash bash-completion
COPY .bashrc /root/.bashrc
COPY .bash_completion /root/.bash_completion
ARG tag
ENV CALM_DSL_TAG=$tag
CMD ["bash"]