-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathDockerfile.ubi
More file actions
62 lines (55 loc) · 1.85 KB
/
Copy pathDockerfile.ubi
File metadata and controls
62 lines (55 loc) · 1.85 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# syntax = docker/dockerfile:experimental
# Interim container so we can copy pulumi binaries
FROM redhat/ubi9-minimal:latest as builder
ARG PULUMI_VERSION
RUN microdnf upgrade -y && microdnf install -y \
gzip \
tar
# Install the Pulumi SDK, including the CLI and language runtimes.
RUN curl -fsSL https://get.pulumi.com/ | bash -s -- --version $PULUMI_VERSION
# The runtime container
FROM redhat/ubi9-minimal:latest
ARG LANGUAGE_VERSION
LABEL org.opencontainers.image.description="Pulumi CLI container for python"
WORKDIR /pulumi/projects
# Install needed tools, like git, and build dependencies
RUN microdnf upgrade -y && microdnf install -y \
bzip2 \
bzip2-devel \
ca-certificates \
findutils \
gcc \
gdbm-libs \
git \
libffi-devel \
libnsl2 \
libuuid-devel \
make \
ncurses \
ncurses-devel \
openssl-devel \
patch \
readline \
sqlite \
sqlite-devel \
tar \
xz-devel \
zlib-devel
# Install python using pyenv
RUN git clone --depth=1 https://github.com/pyenv/pyenv.git /usr/local/share/pyenv
ENV PYENV_ROOT=/usr/local/share/pyenv
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
RUN pyenv install ${LANGUAGE_VERSION}
RUN pyenv global ${LANGUAGE_VERSION}
# Install poetry
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/usr/local/share/pypoetry python3 -
RUN ln -s /usr/local/share/pypoetry/bin/poetry /usr/local/bin/
# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | XDG_BIN_HOME=/usr/local/share/uv bash -s -- --no-modify-path
RUN ln -s /usr/local/share/uv/uv /usr/local/bin/
RUN ln -s /usr/local/share/uv/uvx /usr/local/bin/
# Uses the workdir, copies from pulumi interim container
COPY --from=builder /root/.pulumi/bin/pulumi /pulumi/bin/pulumi
COPY --from=builder /root/.pulumi/bin/*-python* /pulumi/bin/
ENV PATH "/pulumi/bin:${PATH}"
CMD ["pulumi"]