Commit fdbc053a authored by Romain Lacroix's avatar Romain Lacroix

support for cgroup2 / ubuntu22: IS_CONTAINER is derived from IS_DOCKERBUILD...

support for cgroup2 / ubuntu22: IS_CONTAINER is derived from IS_DOCKERBUILD which is declared in Dockerfile
parent 2db8bca2
...@@ -40,12 +40,14 @@ case "$OS_DISTRO" in ...@@ -40,12 +40,14 @@ case "$OS_DISTRO" in
esac esac
IS_CONTAINER=`egrep -c "docker|kubepods|podman|buildah|libpod" /proc/self/cgroup || true` IS_CONTAINER=`egrep -c "docker|kubepods|podman|buildah|libpod" /proc/self/cgroup || true`
IS_DOCKERBUILD=${IS_DOCKERFILE:-0}
if [ $IS_CONTAINER -eq 0 ] if [ $IS_CONTAINER -eq 0 ] && [ $IS_DOCKERBUILD -eq 0 ]
then then
SUDO='sudo -S -E' SUDO='sudo -S -E'
else else
SUDO='' SUDO=''
IS_CONTAINER=1
fi fi
############################### ###############################
...@@ -83,7 +85,7 @@ echo_info() { cecho "$*" $blue ;} ...@@ -83,7 +85,7 @@ echo_info() { cecho "$*" $blue ;}
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# From https://stackoverflow.com/questions/4023830/how-to-compare-two-strings-in-dot-separated-version-format-in-bash # From https://stackoverflow.com/questions/4023830/how-to-compare-two-strings-in-dot-separated-version-format-in-bash
# arg1 is a dotted (or not) version number (ex 4.10.6.56-ubunutu) # arg1 is a dotted (or not) version number (ex 4.10.6.56-ubunutu)
# arg2 is a dotted (or not) version number (ex 4.10.6.56-ubunutu) # arg2 is a dotted (or not) version number (ex 4.10.6.56-ubunutu)
# return 0 if $1 lower or equal $2, else 1 # return 0 if $1 lower or equal $2, else 1
version_le() { version_le() {
...@@ -177,8 +179,8 @@ disable_ipv6() { ...@@ -177,8 +179,8 @@ disable_ipv6() {
# arg1 = version # arg1 = version
# arg2 = req_version # arg2 = req_version
# #
function version_gt() { function version_gt() {
test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1";
} }
...@@ -318,5 +320,3 @@ set_openair_env(){ ...@@ -318,5 +320,3 @@ set_openair_env(){
openair_path=${openair_path%/src/s6a/*} openair_path=${openair_path%/src/s6a/*}
export OPENAIRCN_DIR=$openair_path export OPENAIRCN_DIR=$openair_path
} }
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#--------------------------------------------------------------------- #---------------------------------------------------------------------
FROM registry.access.redhat.com/ubi8/ubi:latest AS oai-smf-builder FROM registry.access.redhat.com/ubi8/ubi:latest AS oai-smf-builder
ENV IS_DOCKERFILE=1
# Copy the entitlements # Copy the entitlements
COPY ./etc-pki-entitlement /etc/pki/entitlement COPY ./etc-pki-entitlement /etc/pki/entitlement
......
...@@ -35,6 +35,7 @@ FROM $BASE_IMAGE as oai-smf-base ...@@ -35,6 +35,7 @@ FROM $BASE_IMAGE as oai-smf-base
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris ENV TZ=Europe/Paris
ENV IS_DOCKERFILE=1
RUN apt-get update && \ RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \ DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \ DEBIAN_FRONTEND=noninteractive apt-get install --yes \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment