cancel
Showing results for 
Search instead for 
Did you mean: 
AlessandraS
Flight Engineer
Flight Engineer
  • 206 Views

Lab: Custom Container Images chapter 4 - DO188 v4.14 - Error starting custom-lab container

Jump to solution

Hi, this is my container file (it looks like the one in the GE)

AlessandraS_0-1756376872290.png

The image was build correctly, but when I start the container I get this error.
What should I check?
Thanks

AlessandraS_1-1756376952529.png

 

Tags (3)
1 Solution

Accepted Solutions
Travis
Moderator
Moderator
  • 181 Views

@AlessandraS -

Your container file has a bad entry. There shouldn't be a CMD line in there before Entrypoint. You are supposed to be running an NPM INSTALL so you need the RUN keyword and not CMD. I think if you fix that it might match what is in the solution too.

 

FROM registry.ocp4.example.com:8443/redhattraining/podman-certificate-generator as certs

RUN ./gen_certificates.sh

FROM registry.ocp4.example.com:8443/ubi9/nodejs-22:1
USER root
RUN groupadd -r student && useradd -r -m -g student student && \
    npm config set cache /tmp/.npm --global

COPY --from=certs --chown=student:student /app/*.pem /etc/pki/tls/private/certs/
COPY --chown=student:student . /app/

ENV TLS_PORT=8443 \
    HTTP_PORT=8080 \
    CERTS_PATH="/etc/pki/tls/private/certs"

WORKDIR /app

USER student

RUN npm install --omit=dev

ENTRYPOINT npm start
Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training

View solution in original post

2 Replies
Travis
Moderator
Moderator
  • 182 Views

@AlessandraS -

Your container file has a bad entry. There shouldn't be a CMD line in there before Entrypoint. You are supposed to be running an NPM INSTALL so you need the RUN keyword and not CMD. I think if you fix that it might match what is in the solution too.

 

FROM registry.ocp4.example.com:8443/redhattraining/podman-certificate-generator as certs

RUN ./gen_certificates.sh

FROM registry.ocp4.example.com:8443/ubi9/nodejs-22:1
USER root
RUN groupadd -r student && useradd -r -m -g student student && \
    npm config set cache /tmp/.npm --global

COPY --from=certs --chown=student:student /app/*.pem /etc/pki/tls/private/certs/
COPY --chown=student:student . /app/

ENV TLS_PORT=8443 \
    HTTP_PORT=8080 \
    CERTS_PATH="/etc/pki/tls/private/certs"

WORKDIR /app

USER student

RUN npm install --omit=dev

ENTRYPOINT npm start
Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training
AlessandraS
Flight Engineer
Flight Engineer
  • 176 Views

Right, thanks

Join the discussion
You must log in to join this conversation.