Hi, this is my container file (it looks like the one in the GE)
The image was build correctly, but when I start the container I get this error.
What should I check?
Thanks
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
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
Right, thanks
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.