Skip to content

Instantly share code, notes, and snippets.

@learnitall
Created July 22, 2021 23:17
Show Gist options
  • Save learnitall/9a84c4e035765d5d450c6d01644af654 to your computer and use it in GitHub Desktop.
Save learnitall/9a84c4e035765d5d450c6d01644af654 to your computer and use it in GitHub Desktop.
snafu base image
ARG python=3.6.13
FROM registry.access.redhat.com/ubi8:latest AS snafu-python-build
ARG python
RUN dnf install -y --nodocs \
bzip2 \
bzip2-devel \
clang \
gcc \
git \
libffi-devel \
make \
openssl-devel \
sqlite \
sqlite-devel \
xz-devel \
zlib-devel
ENV PYENV_ROOT=/pyenv
RUN curl https://pyenv.run --output $HOME/pyenv.run && \
chmod +x $HOME/pyenv.run && \
$HOME/pyenv.run
RUN CC=clang /pyenv/bin/pyenv install $python --verbose
ENV PATH=$PYENV_ROOT/versions/$python/bin:$PATH
RUN pip install -U pip && \
pip install wheel setuptools
FROM registry.access.redhat.com/ubi8:latest AS snafu-python-build
ARG python
ENV PATH=/pyenv/versions/$python/bin:$PATH
COPY --from=snafu-python-build /pyenv/versions/$python /pyenv/versions/$python
COPY . /opt/snafu
RUN cd /opt/snafu && \
python setup.py bdist_wheel --verbose
RUN pip install /opt/snafu/dist/snafu-*.whl && \
rm -fr /opt/snafu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment