Skip to content

Commit

Permalink
Fix buildvm fedora
Browse files Browse the repository at this point in the history
  • Loading branch information
mherrmann committed Jul 29, 2021
1 parent b1d0207 commit a3abf0d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
2 changes: 1 addition & 1 deletion fbs/_defaults/src/build/docker/fedora/.bashrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PS1='fedora:\W$ '
source /root/${app_name}/venv/bin/activate

# Display welcome message:
[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd
43 changes: 29 additions & 14 deletions fbs/_defaults/src/build/docker/fedora/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,46 @@ FROM fmanbuildsystem/fedora:25

ARG requirements

# Python 3.6:
RUN dnf install -y python36

# Absolute minimum requirements for building a PyQt5 app with PyInstaller:
RUN dnf install -y libstdc++ freetype binutils

# fpm:
ARG python_version=3.6.12
# List from https://github.com/pyenv/pyenv/wiki#suggested-build-environment:
ARG python_build_deps="make gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel libffi-devel xz-devel"

RUN dnf -y update && dnf clean all

# Install pyenv:
RUN dnf install -y curl git
ENV PYENV_ROOT /root/.pyenv
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
RUN curl https://pyenv.run | bash
RUN pyenv update

# Install Python:
# findutils contains xargs, which is needed for the next step:
RUN dnf install -y findutils
RUN echo $python_build_deps | xargs dnf install -y
RUN CONFIGURE_OPTS=--enable-shared pyenv install $python_version && \
pyenv global $python_version && \
pyenv rehash

# Install fpm:
RUN dnf install -y ruby-devel gcc make rpm-build libffi-devel && \
gem install --no-ri --no-rdoc fpm
gem install --no-document fpm

WORKDIR /root/${app_name}

# Set up virtual environment:
# Install Python requirements:
ADD *.txt /tmp/requirements/
RUN python3.6 -m venv venv && \
venv/bin/python -m pip install --upgrade pip && \
venv/bin/python -m pip install -r "/tmp/requirements/${requirements}"
RUN pip install --upgrade pip && \
pip install -r "/tmp/requirements/${requirements}"
RUN rm -rf /tmp/requirements/

# Welcome message, displayed by ~/.bashrc:
ADD motd /etc/motd

ADD .bashrc /root
ADD .bashrc /root/.bashrc

ADD gpg-agent.conf /root/.gnupg/gpg-agent.conf
# Avoid GPG warning "unsafe permissions":
RUN chmod -R 600 /root/.gnupg
ADD private-key.gpg public-key.gpg /tmp/
RUN dnf install -y gpg rpm-sign && \
Expand All @@ -39,4 +54,4 @@ ADD .rpmmacros /root

RUN dnf install -y createrepo_c

ENTRYPOINT ["/bin/bash"]
ENTRYPOINT ["/bin/bash"]

0 comments on commit a3abf0d

Please sign in to comment.