Is it possible run docker container with redis:2.8 on macOS with M1?
docker log
Setup:
macOS M1
docker-compose.yml with redis 2.8
version: '2'
services:
redis:
image: redis:2.8
ports:
- "6379:6379"
Install docker through official documentation https://docs.docker.com/desktop/install/mac-install/#mac-with-apple-silicon
Run Docker application
Go into Redis2.8
Run container through button on top right corner
I got this error
In another way through
docker-compose up redis
I got this error
If you google the error you are getting runtime ...
failed to create new OS thread (have 2 already; errno=22)
you will see a hit on another StackOverflow question Failed to create new OS thread (have 2 already; errno=22). That looks to provide the answer - the platform of your M1 Mmac is not compatible with that specific image you are using so you need to find an image that will work on your M1 Mac.
Related
I'm currently working in a custom project involving Docker and Jboss. The first 2/3 times that I run the command docker-compose up, the log gets stuck in different part of the build. After those 2/3 attempts, the command works correctly. I'm working on a MacBook Pro 2021 with macOS Ventura 13.0.
The docker-compose file is the following:
version: '2'
services:
webapp:
environment:
- SCRIPT_DEBUG=false
- DEBUG=${WEBAPP}
image:
"${REGISTRY}/ispdev/jboss:743GA-jdk1.8-V2"
ports:
- "${WEBAPP_PORT}:8080"
- "${WEBAPP_DEBUG_PORT}:8787"
volumes:
- "${WS_ROOT_DIR}/${APPL_ROOT}/${WEBAPP_EAR_DIR}/${WEBAPP_FINAL_ARTIFACT}:/opt/eap/standalone/deployments/${WEBAPP_FINAL_ARTIFACT}"
- "${WS_ROOT_DIR}/${COMPOSE_ROOT}/resources/jboss.yml:/usr/local/y2j/jboss.yml"
I've just tried to run several times docker-compose up
What version do you have of docker? docker -v
You may have to reinstall docker. Here is a link
https://docs.docker.com/desktop/install/mac-install/
I tried to run mailhog in Docker using the mailhog/mailhog:latest on Macbook Pro M1.
This is my docker file as swarm.yml:
version: '3'
services:
mailhog:
image: 'mailhog/mailhog:latest'
ports:
- '8025:8025'
deploy:
mode: global
I use docker swarm and run the following commands:
docker swarm init
docker stack deploy -c swarm.yml myapp
But when running docker service ls it said the REPLICAS is 0/1
Anyone has any ideas on how to fix this? Thank you
I have been able to run mailhog with different docker image and thank you Mihai for the pointer!
Using the following post as reference:
Apple Silicon Arm builds #359
The final swarm.yml was changed to:
image: 'jcalonso/mailhog:latest'
And this would fix the issue.
I've built an image (docker buildx) from an ubuntu 18, stored to tar, uploaded on Portainer (running on RPI)
Using Portainer, I create a stack with yaml file, and I get a "deployment error", but the container is created
Below, the composer file content:
version: '2'
services:
sda:
image: <out image>
network_mode: "host"
container_name: "sda4"
volumes:
- virtual_sda4:/opt/<company>/<application>
stdin_open: true
Running the container our app is dumped.
Connecting with console as root user, listing files has a strange result:
all files have "undefined" permissions (question marks instead of rwx)
It seems a permission issue.
(*) stdin_open: true: used to keep alive the container, because the app is dumped.
Any idea is appreciated
Thanks
Lorenzo
Just an update on this topic. The problem was linked to different docker version used for building and deploying the images. The builder was 20., the version on RPI was 18.. Updating the version on RPI, provided by the board integratori, solved the issue.
Hoping this is useful to others.
Lorenzo
docker-compose.exe up shows
ERROR: Network "docker_default" needs to be recreated - option "com.docker.network.windowsshim.networkname" has changed
after the last Docker update yesterday, under Windows 10 Pro. How can I do that?
Docker version: 17.06.1-ce
build: 874a737
I would like to run 2 docker images with docker-compose.
one image should run with nvidia-docker and the other with docker.
I've seen this post use nvidia-docker-compose launch a container, but exited soon
but this is not working for me(not even running only one image)...
any idea would be great.
UPDATE : please check nvidia-docker 2 and its support of docker-compose first
https://github.com/NVIDIA/nvidia-docker/wiki/Frequently-Asked-Questions#do-you-support-docker-compose
(I'd first suggest adding the nvidia-docker tag).
If you look at the nvidia-docker-compose code here it only generates a specific docker-file for docker-compose after a query of the nvidia configuration on localhost:3476.
You can also make by hand this docker-compose file as they turn out to be quite simple, follow this example, replace 375.66 with your nvidia driver version and put as many /dev/nvidia[n] lines as you have graphic cards (did not try to put services on separate GPUs but go for it !):
services:
exampleservice0:
devices:
- /dev/nvidia0
- /dev/nvidia1
- /dev/nvidiactl
- /dev/nvidia-uvm
- /dev/nvidia-uvm-tools
environment:
- EXAMPLE_ENV_VARIABLE=example
image: company/image
volumes:
- ./disk:/disk
- nvidia_driver_375.66:/usr/local/nvidia:ro
version: '2'
volumes:
media: null
nvidia_driver_375.66:
external: true
Then just run this hand-made docker-compose file with a classic docker-compose command.
Maybe you can then compose with non nvidia dockers by skipping the nvidia specific stuff in the other services.
Additionally to the accepted answer, here's my approach, a bit shorter.
I needed to use the old version of docker-compose (2.3) because of the required runtime: nvidia (won't necessarily work with version: 3 - see this). Setting NVIDIA_VISIBLE_DEVICES=all will make all the GPUs visible.
version: '2.3'
services:
your-service-name:
runtime: nvidia
environment:
- NVIDIA_VISIBLE_DEVICES=all
# ...your stuff
My example is available here.
Tested on NVIDIA Docker 2.5.0, Docker CE 19.03.13 and NVIDIA-SMI 418.152.00 and CUDA 10.1 on Debian 10.