"OCI runtime create failed " issue running script on MacOS using Docker host - image

I'm trying to run pishrink on MacOS using a Docker host, as explained here. The pishrink script shrinks the size of an .img so it's quicker to burn onto an SD card.
I have Docker Desktop running, and I've add the repo to the top-level in my file system (/pishrink) and and running the following command:
docker-compose run pishrink /pishrink/pishrink.sh /pishrink/big-image.img /pishrink/small-image.img
When I do, I get the following error:
Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"/pishrink/pishrink.sh\": permission denied": unknown
Can someone help me debug this issue? I'm relatively new to using Docker so I might be making some simple + fundamental mistakes.

I was able to fix this with the following command, using sudo as suggested:
sudo docker-compose run pishrink /pishrink/pishrink.sh /pishrink/big-image.img /pishrink/small-image.img

Related

Is the docker daemon running? Spring-boot java project on Ubuntu

I have Ubuntu 22.04,
I have Java Spring-boot project, I run Idea, then run docker-compose.yml and get this message:
Cannot connect to the docker daemon at unix:///var/run/docker.sock.
Is the docker daemon running? (Details:[13] Permission denied)
What should I check?
You can take this perfect Tutorial: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04
The important section for you is: Step 2 — Executing the Docker Command Without Sudo (Optional)
Your Problem is that you try to use docker without sudo. You have no permission for that.

docker image created with nix – how to load on Windows?

We're getting
C:\Users\Alice\Downloads> docker load -i
.\demccqjb91lx4ycymhg0rp9q3fd8zx65-docker-image-foo.tar.gz
open /var/lib/docker/tmp/docker-import-2092215042/repositories: no
such file or directory
when trying to load a docker image created with a simple regular nix-build docker.nix (as in https://github.com/bradparker/haskell-on-heroku ).
If we try docker import instead of docker load, it seems to load but then on docker run it says docker: Error response from daemon: No command specified.
Is there some special ceremony needed for Windows deployment?

What to do when Memgraph stops working without any info?

Sometimes the Docker container where Memgraph is running just stops working or says that the process was aborted with exit code 137. How can I fix this?
You should check the Memgraph logs, where you'll probably find the reason why the process was aborted.
Since you said that you're using Memgraph with Docker, there are two options:
If you run Memgraph with Docker using the volume for logs, that is with
-v mg_log:/var/log/memgraph, then mg_log folder usually can be found at \\wsl$\docker-desktop-data\version-pack-data\community\docker\volumes\ (Windows) or /var/lib/docker/volumes/ (Linux and macOS).
If you run Memgraph without using the volume for logs, then you need to enter the Docker container. In order to do that, first you have to find out the container ID by running docker ps. Then you have to copy the container ID and run docker exec -it <containerID> bash. For example, if container ID is 83d76fe4df5a, then you run docker exec -it 83d76fe4df5a bash. Next, you need find the folder where logs are located. You can do that by running cd /var/log/memgraph. To read the logs, run cat <memgraph_date>.log, that is, if you have log file memgraph_2022-03-02.log located inside the log folder, then run cat memgraph_2022-03-02.log.
Hopefully, when you read the logs, you'll be able to fix your problem.

Docker Engine not running in Mac M1 series

Problem : I was trying to set up Docker on my Mac M1, docker engine was somehow keep running (it was in kind of hung state). When I tried running docker ps command, I used to get the error "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"
Solution: In Docker Desktop go to settings and try these two steps:-
Clean/purge data
Reset to Factory defaults.
Doing this helped me to fix the issue.

fork/exec ./debug: operation not permitted

My goal is to be able to remote debug from Atom.io. into a docker container running go in dlv debugger. This is the first problem:
Update:1. I am running Docker container on a mac, but that should not influence the code signing thing as I am running in a container, right?
Update:2. Codesignig the host, did not help.
Error:
1. root#...:/go/src/app# go get github.com/derekparker/delve/cmd/dlv
2. root#...:/go/src/app# dlv debug hello.go
could not launch process: fork/exec ./debug: operation not permitted
Then tried to
1. root#...:/go/src/app# sudo
2. bash: sudo: command not found
According Delve Issue #515
Docker has security settings preventing ptrace(2) operations by
default with in the container. Pass --security-opt seccomp:unconfined
to docker run when starting.
*confirmation of this in official docker bug tracker https://github.com/docker/docker/issues/21051
It seems to work if you start the container with --privileged. I've tried to figure out if there is a more fine-grained capability but failed.
Also I just found https://github.com/steeve/homebrew-delve which should make things easier on OSX.
Docker has security settings preventing ptrace(2)
See how i fixed it.
if using a docker-compose file to run the container then append seccomp:unconfined in the services section like below
api:
security_opt:
- seccomp:unconfined
if using docker run ...passing seccomp:unconfined works as well
Run Docker container as a command:
docker run -itd -p 2028:22 -p 2345:2345 --dns=10.236.8.8 --privileged=true --name=golang centos7-golang /usr/bin/supervisord
it works for me~

Resources