Upgrade Gitlab from source 7.4 to Docker 10.4 - docker

I've been looking around for people trying to do such madness but can't find anything.
What I'm trying to do is upgrade from an old, unmaintained version of Gitlab 7.4.2 that was running on a server to a Docker version on 10.4.
I did my backup correctly with 7.4 but obviously as I'm trying to unpack it, I get the following :
Your current GitLab version (10.4.2) differs from the GitLab version in the backup!
Please switch to the following version and try again:
version: 7.4.2
I'm not sure of the procedure I should do next but have a few ideas I'd like to run by you here to see which is the easiest/most doable.
Upgrade my bare-metal server gradually from 7.4 to 8.x, then to 9.x to have the minimum Docker version present on Docker Hub. Then do a backup and repeat the process on Docker.
Force (how?) the Docker version to take this backup anyway
An other solution maybe ?
Thanks in advance for any help.

Madness indeed....
The brute force take of upgrading here is probably the way to go, as this is by far the safest one.
The only alternative I can offer is to migrate your source instance to the omni-bus installation of the same version an then let the package manager deal with the mess and update to the latest version.
But you should prepared for problems. Non omni-bus to omni-bus installations are not tested. If you want to try it anyway, here is the upgrade guide for the omni-bus versions.
If you have then the newest version you can simply export and import it into the docker instance as the docker image simply contains a omni-bus instance.

You can not upgrade Gitlab directly and must upgrade it step by step to the next major release: 7 -> 8 -> 9 -> 10.
You can see more information in the link below:
[https://docs.gitlab.com/ee/policy/maintenance.html#upgrade-recommendations][1]
and execute the following commands:
sudo docker stop gitLab
sudo docker rm gitLab
You can see more information in the link below:
[https://docs.gitlab.com/omnibus/docker/README.html#upgrade-gitlab-to-newer-version][1]
and after executing 2 above commands you can change the GitLab version that existing in the content of the docker-compose.yml .
examlpe:
gitlab:
restart: always
image: sameersbn/gitlab:11.11.0
depends_on:
- redis
- postgresql
to chenged:
gitlab:
restart: always
image: sameersbn/gitlab:12.7.6
depends_on:
- redis
- postgresql
and execute the following command:
sudo docker-compose up -d
Repeat these stages and Step by step between the GitLab versions to get the desired version.

Related

Deploy Vaadin23 Application with Docker

There is a blog, how to do it with Java Version 11:
https://vaadin.com/blog/how-to-create-a-docker-container-for-a-vaadin-java-app
When i follow this guide and use Java11 for the Application, everything is good.
But when i try to use the same manner for Java17 (the latest LTS), the docker image build is successfull, but the container crashes with a tomcat-server issue:
error log at running container
Did anyone ran the same issue or know how to fix this. The blog-post about dockerize a vaadin app seems to be outdated, and there isn't one out for Java version 17.
To replicate the issue, go to the starter https://start.vaadin.com/app and choose Java 17. Then follow this Blogpost https://vaadin.com/blog/how-to-create-a-docker-container-for-a-vaadin-java-app to dockerize it and replace the openjdk-image version to 17.
Build and then run the container. Appreciate any help.
You can check a box for "Docker config" under Java version in start.vaadin.com to generate a Dockerfile for your app before downloading.
You can then build the container using the docker build . -t myapp:latest command and run it on localhost using docker run -p 8080:8080 myapp:latest
You can also find these instructions and instructions on how to add a Dockerfile to existing Vaadin 23 applications in the Vaadin 23 technical documentation: https://vaadin.com/docs/latest/production/docker

How do you resolve the GitLab error "Error response from daemon: invalid condition: 'not-running'"?

I set up a Windows GitLab runner that's supposed to download a Docker image from our Container Registry and then run a build script in the pipeline. Unfortunately the Docker container never launches due to the following error:
Running with gitlab-runner 15.1.0 (76984217)
on WindowsDockerRunner wZMWQZYi
Resolving secrets
Preparing the "docker-windows" executor
Using Docker executor with image mcr.microsoft.com/windows/servercore:ltsc2019 ...
Pulling docker image mcr.microsoft.com/windows/servercore:ltsc2019 ...
Using docker image sha256:e6b07227af5ca9303c2112b574f6f27f38135bbf9df29d829142410221967401 for mcr.microsoft.com/windows/servercore:ltsc2019 with digest mcr.microsoft.com/windows/servercore#sha256:26c6c296a4737ba478fe3c3e531b098f89b5562c40b416ba6fb8177ac462d1af ...
Preparing environment
Running on RUNNER-WZMWQZYI via
runner2...
ERROR: Job failed (system failure): prepare environment: Error response from daemon: invalid condition: "not-running". Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information
The error message doesn't clearly state what the cause of the problem is and the documentation that it references doesn't mention anything about "condition". Based on the link pointing to shell profiles I suspect it might have something to do with the shell that's being run, but when I run the Docker container locally it boots into PowerShell just fine.
Does anyone know how to solve this?
I came across this issue after installing Docker Engine using the Windows Server install script, which fetches docker.exe and dockerd.exe from https://master.dockerproject.org, These builds were last updated in March 2022, I found gitlab-runner 14.9 and earlier work okay with this version (released prior to March 2022), but 14.10 does not (released 2022-04-19) nor do any newer versions.
Installing Docker Desktop resolves this as it provides the latest version. However using Docker Desktop introduces licensing issues. An alternative is to manually install Docker Engine / update the version downloaded by the Microsoft script.
Docker Engine builds are provided on the Moby GitHub project to download from https://download.docker.com/win/static/stable/x86_64/ downloading the lastest version from here and replacing the docker executables in C:\Windows\System32 fixes the problem, working with the latest gitlab-runner.
An alternative is to use the docker-engine chocolatey package (which incidentally I maintain) which provides installation scripting for the above stable builds:
choco install docker-engine
There is also an open issue with the Windows-Containers team to move off (out of date) nightlies: https://github.com/microsoft/Windows-Containers/issues/256 which would provide a stable docker build, through the Microsoft recommended installation method.
Was finally able to solve this issue. We had the Docker Engine installed on our GitLab Runner, but that doesn't seem to be sufficient for GitLab CI/CD. After installing Docker Desktop on the runner the issue disappeared and we were able to run the pipeline.
After some trial and error I got it up and running.
I have another server running the gitlab-runner and docker without any issues (no docker desktop installed, which is not allowed because of licensing stuff).
The server I'm trying to setup right now is a 'redundancy' build server.
So to find out what was my problem, I started switching things from one build server to the other. Currently, it appears that simply downgrading to the gitlab-runner V13.4.0 was enough.
I did reregister the runner, since gitlab stated that the V15.x.x version was using executor "unknown".
Not sure what is going on there, but at least I can continue building now.

Is there an automatic roll forward for minor/patch versions of .NET 5 in Dockerfile

When starting a .NET 5 project locally there is an automatic roll forward, meaning when starting the project the runtime will choose the newest minor/patch version installed on the system.
For deploy to production I use docker with a typical Dockerfile with lines like
FROM mcr.microsoft.com/dotnet/sdk:5.0
and
FROM mcr.microsoft.com/dotnet/aspnet:5.0
When typing "dotnet --info" on the server where the docker image is running on I always get version "5.0.0".
I would like to know if I have to enter the correct minor/patch versions manually in the Dockerfile each time a new version is released or if there is a version specifier to install those small versions with automatic roll forward.
mcr.microsoft.com/dotnet/sdk:5.0 is a floating tag. It always refers to the latest patch in that major.minor release:
The tag is updated to always reference the most recent patch that is currently available for the Major.Minor release.
For example, if you inspect the docker image today, you should see this is a 5.0.102 SDK and 5.0.2 Runtime image:
$ podman inspect mcr.microsoft.com/dotnet/sdk:5.0 --format='json' | jq '.[0].Config.Env'
[
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"ASPNETCORE_URLS=",
"DOTNET_RUNNING_IN_CONTAINER=true",
"DOTNET_VERSION=5.0.2",
"ASPNET_VERSION=5.0.2",
"DOTNET_SDK_VERSION=5.0.102",
"DOTNET_USE_POLLING_FILE_WATCHER=true",
"NUGET_XMLDOC_MODE=skip",
"POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-DotnetSDK-Debian-10"
]
If you are seeing that this is still 5.0.0 on you server, you might be using an older container. By default docker run will run the image last pulled, without checking for an update.
You might need to docker pull to explicitly update the image, or use docker run --pull=always to make sure you are running the latest container image.

gitlab ci with conda not using the latest package version

I am using a docker image from by Continuum Analytics in my .gitlab-ci.yml file, in order to use conda (as well explained here)
Everything works fine except for one detail: I cannot get the latest version of a package published on a specific channel (this one, but that shouldn't matter) - the latest version is 0.2.6, but the version 0.2.3 is installed.
If I specify in my environment.yaml file that I want a specific version:
dependencies:
- presamples>=0.2.6
I get the following error during build:
ResolvePackageNotFound:
- presamples[version='>=0.2.6']
Are Continuum Analytics docker image not able to download versions of packages that were created after the docker image was created? This may be a silly question, I don't know anything about docker...

How to check the docker-compose file version?

I would like to make sure that I'm using version 3 of the compose file format. However, on https://docs.docker.com/compose/compose-file/ I was not able to find out how to do this.
My Docker version is 17.04.0-ce, build 4845c56, and my Docker-Compose version is docker-compose version 1.9.0, build 2585387. I'm not sure since when version 3 of the compose file format was introduced, however. How can I find this out?
It's on your docker-compose.yml file. First parameter is Docker Compose version.
version: '3'
Docker Compose version file 3 was introduced in release 1.10.0 of Docker Compose and 1.13.0 release of Docker Engine.
Here you can see release notes for Docker Compose 1.10.0 which introduces version file 3: https://github.com/docker/compose/releases/tag/1.10.0
The docker compose version 3 syntax requires docker version 1.13 and docker-compose version 1.10 (see the release notes). See the release notes for the version compatibility matrix and upgrade instructions.
Note that the version 3 syntax is designed for docker swarm mode, and it was first supported with the docker stack deploy in docker release 1.13. There's not much reason to upgrade to the version 3 syntax if you are still using docker-compose itself.
See also the compose file versioning page that describes the differences between the different yml versions.

Resources