docker.errors.DockerException: Error while fetching server API version or Permission denied error
Figured it out we need to add this to docker-compose file and give right permission to it below
- //var/run/docker.sock:/var/run/docker.sock
sudo chmod 666 /var/run/docker.sock
This is how common-part of docker-compose file looks like now:
volumes:
- ./dags:/opt/airflow/dags
- ./logs:/opt/airflow/logs
- ./plugins:/opt/airflow/plugins
- //var/run/docker.sock:/var/run/docker.sock
How can I debug `Error while fetching server API version` when running docker?
I guess your Airflow Docker container is trying to launch a worker on the same Docker machine where it is running. To do so, you need to give Airflow's container special permissions and, as you said, acces to the Docker socket. This is called Docker In Docker (DIND). There are more than one way to do it. In this tutorial there are 3 different ways explained. It also depends on where those containers are run: Kubernetes, Docker machines, external services (like GitLab or GitHub), etc.
Docker Error while fetching server API version
In your program add a line after gym.make as follows,
env = gym.make('flashgames.DuskDrive-v0')
env.configure(remotes="vnc://localhost:5900+15901")
observation_n = env.reset()
save it.
Now open two terminal windows. In first type,
sudo docker run -p 5900:5900 -p 15901:15901 --privileged --cap-add SYS_ADMIN --ipc host quay.io/openai/universe.flashgames:0.20.7
Some gibberish will start appearing. Now till that thing is going on, in the next window you open your anaconda environment using command,
source activate universe
Then you run your python code as, python "path_name"/"program_name".py
For complete guide please refer to this link -
https://alliseesolutions.wordpress.com/2016/12/08/openai-universe-installation-guide-ubuntu-16-04/
https://medium.com/@alexbhandari/openai-universe-getting-started-on-mac-52d601ef9161#.p8njfuqff
Error connecting: Error while fetching server API version: Ansible
I've found solution is Docker
daemon is not working after Docker
was installed by Ansible
. It's required to add following command in my play board.
---
- hosts: webservers
remote_user: ec2-user
become: yes
become_method: sudo
tasks:
- name: install docker
yum: name=docker
**- name: Ensure service is enabled
command: service docker restart***
- name: copying file to remote
copy:
src: ./docker
dest: /home/ec2-user/docker
- name: Build Docker image from Dockerfile
docker_image:
name: web
path: /home/ec2-user/docker
state: build
- name: Running the container
docker_container:
image: web:latest
name: web
- name: Check if container is running
shell: docker ps
Related Topics
How to Emulate a Do-While Loop
I Can't Install Pyaudio on Windows? How to Solve "Error: Microsoft Visual C++ 14.0 Is Required."
What's the Correct Way to Convert Bytes to a Hex String in Python 3
What Is the Most Efficient Way to Loop Through Dataframes with Pandas
How to Use String.Replace() in Python 3.X
Should Wildcard Import Be Avoided
Stripping Everything But Alphanumeric Chars from a String in Python
What Does Asterisk * Mean in Python
How to Add File Extensions Based on File Type on Linux/Unix
Clang Error: Unknown Argument: '-Mno-Fused-Madd' (Python Package Installation Failure)
How to Subtract a Day from a Date
Python: Removing List Element While Iterating Over List
Is There a Simple Way to Delete a List Element by Value