# CMAKE\_SYSTEM variable incorrect in Jenkins Docker container

**URL:** https://discourse.cmake.org/t/cmake-system-variable-incorrect-in-jenkins-docker-container/10758
**Category:** Code
**Tags:** os:linux
**Created:** [April 29, 2024, 1:56pm UTC](https://discourse.cmake.org/t/cmake-system-variable-incorrect-in-jenkins-docker-container/10758 "2024-04-29T13:56:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bp7878](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/8e8cbc/32.png) [@bp7878](https://discourse.cmake.org/u/bp7878)
#### Post date: [April 29, 2024, 1:56pm UTC](https://discourse.cmake.org/t/cmake-system-variable-incorrect-in-jenkins-docker-container/10758/1 "2024-04-29T13:56:10Z")

</div>

I’m running a build pipeline within a redhat 8 docker container on jenkins. Part of the cmake build is doing OS checks. When running natively, on a RHEL 8 system, I get the expected current kernel version and el8\_x version number.

Within the jenkins EL8 docker container in Jenkins, I’m getting a RHEL 9 kernel version which leads to determination of the OS to be el9.x. What’s going on here? the CMAKE version variables are the correct RHEL 8 version, as well. And LSB returns the correct el8 version as well.

– CMAKE\_MAJOR\_VERSION: 3  
– CMAKE\_MINOR\_VERSION: 26  
– CMAKE\_PATCH\_VERSION: 5  
– CMAKE\_SYSTEM\_INFO\_FILE: Platform/Linux  
– CMAKE\_SYSTEM\_NAME: Linux  
– CMAKE\_SYSTEM\_PROCESSOR: x86\_64  
– CMAKE\_SYSTEM\_VERSION: 5.14.0-362.24.1.el9\_3.x86\_64  
– CMAKE\_HOST\_SYSTEM\_VERSION: 5.14.0-362.24.1.el9\_3.x86\_64  
– CMAKE\_SYSTEM: Linux-5.14.0-362.24.1.el9\_3.x86\_64  
– LSB\_RELEASE\_ID\_SHORT: RedHatEnterprise  
– LSB\_RELEASE\_VERSION\_SHORT: 8.9

---

<div class="post-metadata">

### Author: ![fenrir](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fenrir/32/734_2.png) [@fenrir](https://discourse.cmake.org/u/fenrir)
#### Post date: [April 29, 2024, 2:04pm UTC](https://discourse.cmake.org/t/cmake-system-variable-incorrect-in-jenkins-docker-container/10758/2 "2024-04-29T14:04:24Z")

</div>

Docker container use the host OS kernel.  
I suppose CMake discovers the OS version using `uname -r` or something like that.

See also:

> <https://stackoverflow.com/questions/31012297/uname-a-returning-the-same-in-docker-host-or-any-docker-container>

---

<div class="post-metadata">

### Author: ![bp7878](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/8e8cbc/32.png) [@bp7878](https://discourse.cmake.org/u/bp7878)
#### Post date: [April 29, 2024, 2:20pm UTC](https://discourse.cmake.org/t/cmake-system-variable-incorrect-in-jenkins-docker-container/10758/3 "2024-04-29T14:20:15Z")

</div>

ah yes. Completely forgot about that. Thanks for the info! Will re-tool to use the output of os-release and/or lsb\_release.
