Docker compose

Currently reading
Docker compose

26
3
NAS
Ds414
Operating system
  1. Windows
Mobile operating system
  1. Android
I am seeing many file sharing docker apps that either require or claim to be easier to install via docker compose I have googled compose for synology and seen references to the fact that compose is installed when installing docker. if this is the case how do I open compose and how would I install a container using compose on the nas ?
 
The idea is to have a docker-compose compatible Docke rfile file ready (docker-compose.yml). Something like this

Code:
version: "3.5"
services:
  mc:
    image: blackvoidclub/midnight-commander:latest
    container_name: mc
    volumes:
      -  "/:/mnt/host"
    restart: always

Save it in a folder of your choice on the nas and then log into your NAS using SSH as root user.

You will then navigate to that folder with the file and run this command:

docker-compose up -d

This will read the YML file in that folder and run the process of downloading the image, setting up the container with the parameters configured and all the rest.
 
The idea is to have a docker-compose compatible Dockerfile file ready (docker-compose.yml). Something like this

Code:
version: "3.5"
services:
  mc:
    image: blackvoidclub/midnight-commander:latest
    container_name: mc
    volumes:
      -  "/:/mnt/host"
    restart: always

Save it in a folder of your choice on the nas and then log into your NAS using SSH as root user.

You will then navigate to that folder with the file and run this command:

docker-compose up -d

This will read the YML file in that folder and run the process of downloading the image, setting up the container with the parameters configured and all the rest.
i tried installing lidarr using the code from linux server which was

version: "2.1"
services:
lidarr:
image: ghcr.io/linuxserver/lidarr
container_name: lidarr
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
volumes:
- /path/to/appdata/config:/config
- /path/to/music:/music #optional
- /path/to/downloads:/downloads #optional
ports:
- 8686:8686
restart: unless-stopped

i saved this code as docker-compose.yml using visual studio on win 10 and saved to a folder within docker called lidarr, i then navigated to docker/lidarr and ran cmd docker-compose up -d using putty but get a bunch of exception errors i also tried changin puid and pgid to my own but same errors. what am i doing wrong ?
 
share the errors. let’s start there.
ok here goes test i get back after running docker-compose up -d from directory where yml file is saved.

Traceback (most recent call last):
File "urllib3/connectionpool.py", line 677, in urlopen
File "urllib3/connectionpool.py", line 392, in _make_request
File "http/client.py", line 1277, in request
File "http/client.py", line 1323, in _send_request
File "http/client.py", line 1272, in endheaders
File "http/client.py", line 1032, in _send_output
File "http/client.py", line 972, in send
File "docker/transport/unixconn.py", line 43, in connect
PermissionError: [Errno 13] Permission denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "requests/adapters.py", line 449, in send
File "urllib3/connectionpool.py", line 727, in urlopen
File "urllib3/util/retry.py", line 410, in increment
File "urllib3/packages/six.py", line 734, in reraise
File "urllib3/connectionpool.py", line 677, in urlopen
File "urllib3/connectionpool.py", line 392, in _make_request
File "http/client.py", line 1277, in request
File "http/client.py", line 1323, in _send_request
File "http/client.py", line 1272, in endheaders
File "http/client.py", line 1032, in _send_output
File "http/client.py", line 972, in send
File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', PermissionError(13, 'P ermission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "docker/api/client.py", line 214, in _retrieve_server_version
File "docker/api/daemon.py", line 181, in version
File "docker/utils/decorators.py", line 46, in inner
File "docker/api/client.py", line 237, in _get
File "requests/sessions.py", line 543, in get
File "requests/sessions.py", line 530, in request
File "requests/sessions.py", line 643, in send
File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "docker-compose", line 3, in <module>
File "compose/cli/main.py", line 81, in main
File "compose/cli/main.py", line 200, in perform_command
File "compose/cli/command.py", line 70, in project_from_options
File "compose/cli/command.py", line 153, in get_project
File "compose/cli/docker_client.py", line 43, in get_client
File "compose/cli/docker_client.py", line 170, in docker_client
File "docker/api/client.py", line 197, in __init__
File "docker/api/client.py", line 222, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: ('Connec tion aborted.', PermissionError(13, 'Permission denied'))
[642] Failed to execute script docker-compose
 
ok here goes test i get back after running docker-compose up -d from directory where yml file is saved.

Traceback (most recent call last):
File "urllib3/connectionpool.py", line 677, in urlopen
File "urllib3/connectionpool.py", line 392, in _make_request
File "http/client.py", line 1277, in request
File "http/client.py", line 1323, in _send_request
File "http/client.py", line 1272, in endheaders
File "http/client.py", line 1032, in _send_output
File "http/client.py", line 972, in send
File "docker/transport/unixconn.py", line 43, in connect
PermissionError: [Errno 13] Permission denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "requests/adapters.py", line 449, in send
File "urllib3/connectionpool.py", line 727, in urlopen
File "urllib3/util/retry.py", line 410, in increment
File "urllib3/packages/six.py", line 734, in reraise
File "urllib3/connectionpool.py", line 677, in urlopen
File "urllib3/connectionpool.py", line 392, in _make_request
File "http/client.py", line 1277, in request
File "http/client.py", line 1323, in _send_request
File "http/client.py", line 1272, in endheaders
File "http/client.py", line 1032, in _send_output
File "http/client.py", line 972, in send
File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', PermissionError(13, 'P ermission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "docker/api/client.py", line 214, in _retrieve_server_version
File "docker/api/daemon.py", line 181, in version
File "docker/utils/decorators.py", line 46, in inner
File "docker/api/client.py", line 237, in _get
File "requests/sessions.py", line 543, in get
File "requests/sessions.py", line 530, in request
File "requests/sessions.py", line 643, in send
File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "docker-compose", line 3, in <module>
File "compose/cli/main.py", line 81, in main
File "compose/cli/main.py", line 200, in perform_command
File "compose/cli/command.py", line 70, in project_from_options
File "compose/cli/command.py", line 153, in get_project
File "compose/cli/docker_client.py", line 43, in get_client
File "compose/cli/docker_client.py", line 170, in docker_client
File "docker/api/client.py", line 197, in __init__
File "docker/api/client.py", line 222, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: ('Connec tion aborted.', PermissionError(13, 'Permission denied'))
[642] Failed to execute script docker-compose
Guessing you run this as root but looks like there is a permissions problem. Your folder where the config file is mapped to, where is it located?
 
Guessing you run this as root but looks like there is a permissions problem. Your folder where the config file is mapped to, where is it located?
yes sshd in to nas using my main account config file is located in volume1/docker/lidarr. lidarr being the flder i created prior to creating yml config file.
 
Any data in the local folder where config folder is mapped to?
ok so with my limited knowledge it turns out i was logged in as main user but not with root privileges that said errors still persist i am now trying to install picard i created a folder named picard in my docker folder went to the docker hub and copied this code

docker run -d \
--name=picard \
-p 5800:5800 \
-v /path/to/config:/config:rw \
-v /path/to/music:/storage:rw \
mikenye/picard

i pasted this in to visual studio code and saved as docker-compose.yml in /volume1/docker/picard. Then in putty i used cd /volume1/docker/picard command followed by docker-compose up -d command and putty returns this error

ERROR: Top level object in './docker-compose.yml' needs to be an object not '<class 'str'>'.

this is logged in as route i tried the same method with handbrake with the relevant code and this also returned the same error. I want to get my head around this as it seems installing this way is what most people do and automating the install procedure rather than my trying to work out what info goes where in the synology gui.
 
The idea is to have a docker-compose compatible Dockerfile file ready (docker-compose.yml).
Just to make sure people are not going to use Dockerfile as a synonmy for compose files.

A Dockerfile holds the instructions that describe how a Docker Image is build based on these instructions. Typicaly it is used by docker build. Though sometimes people embed build: into the service definition of a compose file, which then actualy will build an image on-the-fly based on a Dockerfile - developers of docker images sometimes use it like that.

@Dazzer12 you might want to read Guide - How to use CODE or ICODE to post codes? about how to embed code snipets in your posts.

Regarding your compose file error: looks like a permission issue. Make sure to allign the values of PUID/PGID with the UID and GID of the owner of the host folder that you try to map into the container.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

More like /volume1/name_of_folder/ Make sure to name the volume correctly
Replies
7
Views
2,628
  • Question
I tried to modify the rights to allow RW to everyone (in File Station) : I synced the data from "local"...
Replies
6
Views
2,456
have you tried to use the same account for both apps?
Replies
15
Views
6,452

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Back
Top