I am trying to deploy the Nginx image using the Redhat UBI image as I build the image which compiles without errors. I get error executable file not found in $PATH": unknown.
Could anyone please tell me what I am missing in my dockerfile?
I am using the image from RedHat UBI open images, using the container images that have been provided.
https://catalog.redhat.com/software/containers/search?q=ubi
Below is my Dockerfile that I am using.
FROM registry.access.redhat.com/ubi8/ubi-init
USER root
COPY api-gatway /usr/share/nginx/html
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]
Below is the error I get after trying to run the docker image
docker run --name testinxcg -d -p 8080:80 test
6220f7274745212afbab07e20bbbf9fa4995a834962b104d7951b6d4965a3237
docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "exec: \"nginx\": executable file not found in $PATH": unknown.
uk-c02xk2ykjg5j:api-gateway mbyousaf$
There's no docker in Red Hat Enterprise Linux (RHEL) 8, but an OCI-compatible alternatives called Podman and Buildah.
To enable container management without the need for daemons, Red Hat has introduced a set of tools for your Linux container application development: Buildah allows you to build a container without any daemon or docker. Podman allows you to manage containers without the daemon dependency it’s also docker cli compatible.
# podman pull
RHEL 8 compatible images can be found [here][2].
# yum install -y podman
# alias docker=podman
type to use podman in place of docker - for using docker commands