Unable to use RUN command in Dockerfile then building image with Podman

I’m trying to integrate Dockerfile image build with Podman into CI Pipeline
The image build failed on “RUN” (everything else in Dockerfile executed fine) command than called in pipeline as:

  • sudo podman build -t tomcat-monitor . --format=docker.

The error is:

  • error: standard_init_linux.go:211: exec user process caused “permission denied”

Image Build Output:

efc739ba65caf1bc86a5034f0402205eff866dccc988837e66dfb6a5bcb8236d
282STEP 5: ENV CATALINA_OPTS="-Xms1200M -Xmx1200M
283214b3495dd35bc4496736f7831ee834b820ff924b174c202e92cb23608306652
284STEP 6: RUN mkdir /opt/monitor/
285standard_init_linux.go:211: exec user process caused “permission denied”

I run it fine as gitlab-runner user from terminal:

Output:

[gitlab-runner@gitlabrunner01 sol------k]$ cd /home/gitlab-runner/builds/y3sSddPc/0/md/ems/jmx-monitor/target
[gitlab-runner@gitlabrunner01 target]$ sudo ./create-image.sh Login Succeeded!
STEP 1: FROM nexus..:5000/base-tomcat:ubi9.0.54

79ab98561a80454d4b39425eb4809cb2fa92fcf5daadb4c43ab2ec5dfad4d4c0
STEP 5: ENV CATALINA_OPTS="-Xms1200M -Xmx1200M
6401d5f5659d62350de131eab7a9a5c081771cbe7186675481a73b3ba9de3f09
STEP 6: RUN mkdir /opt/monitor/**
6b2c6db9a5ade806cf6825f41cea90bfb9694ab93b93ccf2e78a8f9de0f93423**
STEP 7: WORKDIR /opt/monitor

I also tried to call second BASH from CI process, but still have same error.

System Info

  • GitLab:14.6

  • Runner: Group Runner

  • System: Linux 3.10.0-1160.53.1.el7.x86_64

  • Podman: 1.6.4