Replies: 2 comments
-
I think it might be interesting for users, feel free to add it to the wiki, it’s s open for contributions. BTW, since Ubuntu 18.04 is no longer supported we will be switching ci builds to 20.04 soon. |
Beta Was this translation helpful? Give feedback.
-
Added https://github.com/GoldenCheetah/GoldenCheetah/wiki/Docker-container-for-Ubuntu-development Regarding upgrade of development environment to 20.04, I will pay attention, to keep Dockerfile updated, and help if I can (although I am ignorant with Qt, but maybe I can help on other issues) |
Beta Was this translation helpful? Give feedback.
-
Hello, I am investing some time in having the development environment for compiling GoldenCheetah for linux in a Docker container, as an easy, compact and portable way to have GC compiled.
Instead of a Virtual Machine with Ubuntu 18.04, you can create a docker image with that same ubuntu version inside any host machine (with ubuntu I guess, although I am pretty sure it could be different, but needs some furhter investigation). I am running it on Ubuntu 23.04
The image installs all the necessary libraries, packages, etc, needed for ./travis/linux/before_script.sh and script.sh.
Eventually, it calls ./travis/linux/before_script.sh and stops.
It follows the steps that a new development environment should follow to be able to compile the project.
Once the image is created, you can start a container to compile, schedule compilations, or whatever you want
I have got a kind of 'prototype' that fully compiles the binary with a few lines in a Dockerfile.
It can be improved to have a final product if it is interesting for the project.
Advantages are that containers are lighter than virtual machines, as they share the kernel with the host, and that the Dockerfile is the only file you need to install the development environment, holding all the things you need, and automating the steps to compile.
If you consider it is interesting, I can enhance it to have a more or less final product, and see if it can be added to the wiki (Dev Howto Ubuntu 17.10 and QtCreator (debug mode) setup) or wherever you think
Just to note that I have modified a couple of lines of ./travis/linux/before_install.sh to avoid problems or interruptions during image creation:
Adding the repository for R 4.0 is failing, it seems it is out of maintenance, but there is workaroud
Adding '-qq' to the installation of r-base-dev
RUN sed -i "/E298A3A825C0D65DFD57CBB651716619E084DAB9/c\mkdir -p ~/.gnupg && echo \"disable-ipv6\" >> ~/.gnupg/dirmngr.conf && sudo apt-key adv --homedir ~/.gnupg --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9" $TRAVIS_BUILD_DIR/travis/linux/before_install.sh
RUN sed -i "/r-base-dev/c\sudo apt-get install -qq r-base-dev" $TRAVIS_BUILD_DIR/travis/linux/before_install.sh
They could be modified in the script themshelves, independently of this Docker idea, but in case it is not recommended, I have modified it on the fly during the image creation.
For a reference, I am showing the prototype of Dockerfile content:
`
FROM ubuntu:18.04
RUN useradd --create-home appuser
#Install necessary packages
RUN apt update && apt install -y sudo git wget automake libtool bison flex curl software-properties-common && usermod -aG sudo appuser
#Not necessary but recommended
RUN apt install -y procps screen
RUN rm -rf /var/lib/apt/lists/*
#User must have 'sudo' privileges
#Also, it is necessary to set a timezone to avoid interruptions during script execution (can be an environment variable)
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && ln -s /usr/share/zoneinfo/Europe/Madrid /etc/localtime
WORKDIR /home/appuser
USER appuser
ENV TRAVIS_BUILD_DIR=/home/appuser/Git/GoldenCheetah
#To avoid confirmation of github.com
RUN mkdir ~/Git && mkdir -p ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
RUN git clone https://github.com/GoldenCheetah/GoldenCheetah.git $TRAVIS_BUILD_DIR
RUN mkdir $TRAVIS_BUILD_DIR/D2XX
#Changes in the script to work unattended and with no errors
RUN sed -i "/E298A3A825C0D65DFD57CBB651716619E084DAB9/c\mkdir -p ~/.gnupg && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf && sudo apt-key adv --homedir ~/.gnupg --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9" $TRAVIS_BUILD_DIR/travis/linux/before_install.sh
RUN sed -i "/r-base-dev/c\sudo apt-get install -qq r-base-dev" $TRAVIS_BUILD_DIR/travis/linux/before_install.sh
RUN cd $TRAVIS_BUILD_DIR && ./travis/linux/before_install.sh
#That can be useful if running in a limited memory host
#RUN sed -i 's/-j4/-j1/' $TRAVIS_BUILD_DIR/travis/linux/script.sh
`
Beta Was this translation helpful? Give feedback.
All reactions