diff --git a/.gitignore b/.gitignore index d565d59f7bac7dc6274984ec4d75e214643c0a06..53af69d9a20096387ee1e9302b0feb88fc56e067 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ build/ **/.build **/build **__pycache__ +.vscode/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f536f4a388f0870d78935cb7844f21574012848b..e683981eddee66551aa973425f4f72df69797e6a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,37 +1,17 @@ -# This file is a template, and might need editing before it works on your project. -# To contribute improvements to CI/CD templates, please follow the Development guide at: -# https://docs.gitlab.com/ee/development/cicd/templates.html -# This specific template is located at: -# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Docker.gitlab-ci.yml - -# Build a Docker image with CI/CD and push to the GitLab registry. -# Docker-in-Docker documentation: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html -# -# This template uses one generic job with conditional builds -# for the default branch and all other (MR) branches. - -docker-build: - # Use the official docker image. - image: docker:cli +variables: + DOCKER_REGISTRY: docker.control.lth.se + CI_REGISTRY_IMAGE: $DOCKER_REGISTRY/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME +podman-build: + image: quay.io/podman/stable + # tags: + # - docker stage: build - services: - - docker:dind - variables: - DOCKER_IMAGE_NAME: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG - before_script: - - echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin || echo failed - # All branches are tagged with $DOCKER_IMAGE_NAME (defaults to commit ref slug) - # Default branch is also tagged with `latest` script: - - docker build --pull -t "$DOCKER_IMAGE_NAME" . - - docker push "$DOCKER_IMAGE_NAME" + - podman login -u "$DOCKER_REGISTRY_USER" -p "$DOCKER_REGISTRY_PASSWORD" "$DOCKER_REGISTRY" + - podman build -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" . + - podman push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" - | if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then - docker tag "$DOCKER_IMAGE_NAME" "$CI_REGISTRY_IMAGE:latest" - docker push "$CI_REGISTRY_IMAGE:latest" + podman tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" "$CI_REGISTRY_IMAGE:latest" + podman push "$CI_REGISTRY_IMAGE:latest" fi - # Run this job in a branch where a Dockerfile exists - rules: - - if: $CI_COMMIT_BRANCH - exists: - - Dockerfile diff --git a/Dockerfile b/Dockerfile index 8fd261a705a40c799ce844a33448fde7fbd719ad..0f686595b2e4bc560af339975a776a3602712f30 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ FROM ubuntu:jammy +LABEL org.opencontainers.image.authors="marko.guberina@control.lth.se" + # install python3-tk without questions ARG DEBIAN_FRONTEND=noninteractive ENV TZ=Europe/Stockholm -RUN apt-get update && apt install -y --no-install-recommends \ +RUN apt-get update && apt-get install -y --no-install-recommends \ python3 \ python3-pip \ python3-tk \ @@ -13,25 +15,23 @@ RUN apt-get update && apt install -y --no-install-recommends \ sudo \ man-db \ manpages-posix \ - arp-scan - -RUN sed -i 's:^path-exclude=/usr/share/man:#path-exclude=/usr/share/man:' \ - /etc/dpkg/dpkg.cfg.d/excludes -RUN yes | unminimize -# for some reason it's needed again - -# nice to have -RUN apt-get update && apt install -y --no-install-recommends \ + arp-scan \ + # nice to have vim \ + vim-addon-manager \ vim-youcompleteme \ vim-python-jedi \ zsh \ zsh-syntax-highlighting \ - python3-python-qt-binding - + python3-python-qt-binding + # qt-binding is a really unnecessary 300MB, but i don't want # to do more matplotlib hacks +RUN sed -i 's:^path-exclude=/usr/share/man:#path-exclude=/usr/share/man:' \ + /etc/dpkg/dpkg.cfg.d/excludes +RUN yes | unminimize + # make the environment more usable # create user RUN useradd -m -s /bin/zsh -G sudo -u 1000 student @@ -45,8 +45,8 @@ RUN mkdir -p .cache/zsh/ COPY --chown=student /dot_files_for_docker/.vimrc /home/student/ COPY --chown=student /dot_files_for_docker/.zshrc /home/student/ COPY --chown=student /dot_files_for_docker/global_extra_conf.py /home/student/ -RUN vam install python-jedi -RUN vam install youcompleteme + +RUN vam install python-jedi && vam install youcompleteme # this is enough to run clik WORKDIR /home/student/