I got the next error message when I run docker run -p 3000:3000 myimage:
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: open /proc/sys/net/ipv4/ping_group_range: no such file or directory: unknown.
ERRO[0003] error waiting for container: context canceled
The image I build is:
FROM node:16.13.0
WORKDIR /backoffice
COPY . .
VOLUME .
ENV NEXT_TELEMETRY_DISABLED 1
ENV NODE_ENV="production"
RUN npm install --frozen-lockfile
RUN npm run build
EXPOSE 3000
CMD ["npm", "run", "start"]
I tried restarting docker desktop, re-create the image and re-build it and re-install docker app
I tried with other images without no issues.
I'm running:
OS version: OSX ventura (13.1 (22C65)) on a M1
Docker: 4.16.2 (95914)
Xcode: 14.2
Related
I am trying to build this dockerfile and then run it but I'm getting this error docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "./deployment-service": permission denied: unknown.
This is my docker file, I've created the volumes and networks
FROM golang:1.19.2-alpine as builder
RUN apk add bash
RUN apk add --no-cache openssh-client ansible git
RUN mkdir /workspace
WORKDIR /workspace
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY . ./
RUN go build -o deployment-service cmd/deployment-service/main.go
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /workspace .
ARG DEFAULT_PORT=8080
ENV PORT $DEFAULT_PORT
EXPOSE $PORT
CMD ["./deployment-service"]
this is my run command,
docker run --name=${CONTAINER_NAME} -d --rm -p ${PORT}:80 -e DEPLOYMENT_SERVICE_DATABASE_CONNECTION_URI=mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}#${MONGO_CONTAINER_NAME}:27017/ -e DEPLOYMENT_SERVICE_SERVER_SECRET_KEY=${SECRET_KEY} -e ANSIBLE_CONFIG='./jam-ansible/ansible.cfg' -e DEPLOYMENT_SERVICE_ANSIBLE_SUBMISSION_ROOT=${DEPLOYMENT_ROOT} -v ${DEPLOYMENT_VOLUME}:${DEPLOYMENT_ROOT} --network=${NETWORK_NAME} server:latest
help to get my issue solved.
looks like you need to edit the permissions of the deployment-service file.
try running
chmod a+x ./deployment-service
in the terminal then trying again.
Sometimes you may end up getting this error because you have not specified an entrypoint for your container.
You can do that using ENTRYPOINT inside the Dockerfile
Below is a .NET example:
ENTRYPOINT ["dotnet", "application.dll"]
It seems lack of permission to execute deployment-service. You can add
RUN chmod +x deployment-service
before CMD ["./deployment-service"]
In my case, I got the below error while trying to run the container using the command:
docker container run -p portnumber:portnumber amazoncorretto:17-alpine-jdk
ERROR:
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "bash": executable file not found in $PATH: unknown.
I used amazoncorretto:17-alpine-jdk docker image and in dockerfile instead of bash, I changed it to sh and it worked as bash didn't work with alpine.
Command changed from:
CMD ["bash", "-c", "java -jar test.jar"]
to:
CMD ["sh", "-c", "java -jar test.jar"]
I'm trying to setup a gitlab ci/cd pipeline for a vuejs application. The Gitlab runner has been created using Gitlab operator in Openshift environment. Since I need docker image of the application I'm also using buildah tool build docker image from vuejs application.
Now buildah gets installed in Gitlab runner and able to read the Dockerfile from parent directory. But when the runner reaches the npm install command in the dockerfile it throws the following error. I tried adding config.toml files, added memory to the runner. But nothing seems to be working.
.gitlab-ci.yml
image: imagesite.com/fedora:latest
variables:
KUBERNETES_CPU_REQUEST: 3
KUBERNETES_CPU_LIMIT: 5
KUBERNETES_MEMORY_REQUEST: 2Gi
KUBERNETES_MEMORY_LIMIT: 4Gi
STORAGE_DRIVER: vfs
BUILDAH_FORMAT: docker
BUILDAH_FILE: Dockerfile
GIT_SSL_NO_VERIFY: 1
IMAGE_BUILD: buildah build-using-dockerfile
--format docker
--file Dockerfile
--tag
build:
stage: build
tags:
- cu-admin
script:
- pwd
- dnf -y install runc buildah
- buildah images
- echo $REGISTRY_LOGIN
- $REGISTRY_LOGIN
- $IMAGE_BUILD myvuejsapp:latest .
Dockerfile:
FROM node:16.1.0-slim AS NPM_BUILD
WORKDIR /app
COPY ./package.json package.json
COPY ./.env.production.local .env.production.local
COPY ./package-lock.json package-lock.json
COPY ./public public
COPY ./src src
RUN npm install
RUN npm run build
FROM nginx:1.17
COPY ./nginx.conf /etc/nginx/nginx.conf
WORKDIR /code
COPY --from=NPM_BUILD /app/dist .
EXPOSE 8082:8082
CMD ["nginx", "-g", "daemon off;"]
Error from Runner while Building:
STEP 8: RUN npm install
error running container: error from runc creating container for [/bin/sh -c npm install]: time="2021-07-30T07:47:54Z" level=warning msg="unable to get oom kill count" error="no directory specified for memory.oom_control"
time="2021-07-30T07:47:54Z" level=error msg="container_linux.go:380: starting container process caused: process_linux.go:385: applying cgroup configuration for process caused: mkdir /sys/fs/cgroup/cpuset/buildah-buildah541202824: read-only file system"
: exit status 1
error building at STEP "RUN npm install": error while running runtime: exit status 1
time="2021-07-30T07:47:54Z" level=error msg="exit status 1"
How to resolve the above error and install the npm sucessfully?
Try using
buildhah --isolation chroot
I had a similar error trying to run dnf install while building an image within a container. The other answer helped me, but the syntax is wrong... --isolation is an option to the build subcommand, not buildah itself.
Try:
buildah build --isolation chroot <insert other arugments here>
When I just run docker build, I don't have any problems.
But, when I start with docker-compose up :
Cannot start service server: OCI runtime create failed: container_linux.go:370: starting container process caused: exec: permission denied: unknown
Dockerfile
...
ENV CGO_ENABLED=0
ENV GO111MODULE=on
ENV GOFLAGS=-mod=vendor
RUN dep ensure
RUN go mod vendor
RUN go mod download
RUN go mod verify
EXPOSE 8080
ENTRYPOINT ["/go/src/github.com/project/module"]
docker-compose.yaml
...
server:
build:
context: .
dockerfile: service.dockerfile
platform: linux
ports:
- 8080:8080
About docker permissions
Proper solution
You need to have all reqiured permissions for volumes
Add your user to docker group. More info here: https://docs.docker.com/engine/install/linux-postinstall/
Fast and bad solution
Run docker-compose with sudo or as a root: sudo docker-compose -f ... up
The OCI error:
But your problem is not with permisisons, it is with a non-existing program:
ENTRYPOINT ["/go/src/github.com/project/module"]
Is /go/src/github.com/project/module program executable binary with permissions to execute it?
My problem was similar but was with the entrypoint.sh file. What i forgot was to change the permession for this file. "Newbie things :D"
I had this in my file: ENTRYPOINT ["/home/app/web/entrypoint.prod.sh"] and the given below command i used to solve the issue.
chmod +x path-to-file/entrypoint.prod.sh
I'm trying to run an containerized image locally using google cloud shell docker daemon:
> PORT=8080 && docker run -p 9090:${PORT} -e PORT=${PORT} gcr.io/gbl-tpd-endetec-dev1/simplest-helloworld
However i got this error :
> docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"app.py\": executable file not found in $PATH": unknown.
ERRO[0001] error waiting for container: context canceled
When I check container status and in the COMMAND column, i don't have what i expect :
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
977b0ee4b04d gcr.io/gbl-tpd-endetec-dev1/simplest-helloworld "app.py" 11 minutes ago Created 0.0.0.0:9090->8080/tcp youthful_williams
I should have "python ./app.py" since I've written it in my Dockerfile CMD instruction :
# Use the official lightweight Python image.
# https://hub.docker.com/_/python
FROM python:3.7-slim
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8080
CMD ["python", "./app.py"]
Can someone help me about what I am missing?
Getting error while running docker image. It seems to look like the problem is on my pc.
I'm using MacOS 10.13.6.
I have followed steps to create a docker image.
Sanjeet:server-api sanjeet$ docker build -t apicontainer .
Sending build context to Docker daemon 24.01MB
Step 1/2 : FROM alpine:3.6
---> da579b235e92
Step 2/2 : CMD ["/bin/bash"]
---> Running in f43fa95302d4
Removing intermediate container f43fa95302d4
---> 64d0b47af4df
Successfully built 64d0b47af4df
Successfully tagged apicontainer:latest
Sanjeet:server-api sanjeet$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
apicontainer latest 64d0b47af4df 3 minutes ago 4.03MB
alpine 3.6 da579b235e92 2 weeks ago 4.03MB
Sanjeet:server-api sanjeet$ docker run -it apicontainer
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown.
Sanjeet:server-api sanjeet$ ERRO[0001] error waiting for container: context canceled
Inside Dockerfile
FROM alpine:3.6
CMD ["/bin/bash"]
alpine does not include bash by default.
If you want to include bash, you should add RUN apk add --no-cache bash in your Dockerfile.
Issues while running/re-initialize Docker
ERRO[0000] error waiting for the container: context canceled
Steps to Stop the Running Docker Container Forcefully
docker ps
//copy the CONTAINER ID of the running process, ex: CONTAINER ID: 37146513b713
docker kill 37146513b713
docker rm 37146513b713
alpine does not provide glibc. alpine is that small because it uses a stripped down version of libstdc called musl.libc.org.
So we'll check statically linked dependencies using ldd command.
$ docker run -it <image name> /bin/sh
$ cd /go/bin
$ ldd scratch
Check the linked static files, do they exist on that version of alpine? If the do not from, the binaries perspective, it did not find the file-- and will report File not found.
The following step depends on what binaries were missing, you can look it up on the internet on how to install them.
Add RUN apk add --no-cache libc6-compat to your Dockerfile to add libstdc in some Golang alpine image based Dockerfiles.
In you case the solution is to either
disable CGO : use CGO_ENABLED=0 while building
or add
RUN apk add --no-cache libc6-compat
to your Dockerfile
or do not use golang:alpine
I get this error when the network doesn't exist.
docker: Error response from daemon: network xxx not found.
ERRO[0000] error waiting for container: context canceled
It's quite easy to miss the output line after a long docker command and before the red error message.