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:

282STEP 5: ENV CATALINA_OPTS="-Xms1200M -Xmx1200M
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:


[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

STEP 5: ENV CATALINA_OPTS="-Xms1200M -Xmx1200M
STEP 6: RUN mkdir /opt/monitor/**
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