Yacht
Yacht copied to clipboard
Problem with Project with build section
Hi, I created a project and is working, but when I add a build section I get some errors. I'm new to docker and maybe is a stupid question. The docker file, built outside Yacht is working but when I Up the Project I've problems. This's the Project with build section:
version: '3'
services:
vpn:
image: thrnz/docker-wireguard-pia
container_name: pia-wireguard-vpn-proxy
hostname: pia-wg-vpn-proxy
volumes:
# Auth token is stored here
- /yacht/AppData/Config/pia:/pia
# If enabled, the forwarded port is dumped to /pia-shared/port.dat for potential use in other containers
- /yacht/AppData/Config/pia:/pia-shared
cap_add:
- NET_ADMIN
- SYS_MODULE
environment:
- PUID=1000
- PGID=100
- LOC=italy
- USER=***
- PASS=***
- PORT_FORWARDING=1
- PORT_PERSIST=1
- FIREWALL=0
- VPNDNS=1.1.1.1, 1.0.0.1
- LOCAL_NETWORK=10.0.0.0/24, 10.8.0.0/29
sysctls:
# wg-quick fails to set this without --privileged, so set it here instead if needed
- net.ipv4.conf.all.src_valid_mark=1
# May as well disable ipv6. Should be blocked anyway.
- net.ipv6.conf.default.disable_ipv6=1
- net.ipv6.conf.all.disable_ipv6=1
- net.ipv6.conf.lo.disable_ipv6=1
ports:
- 6881:6881
- 6881:6881/udp
- 8081:8081
# The container has no recovery logic. Use a healthcheck to catch disconnects.
healthcheck:
test: ping -c 1 www.google.com || exit 1
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
# Example of another service sharing the VPN
qbittorrent:
image: ghcr.io/linuxserver/qbittorrent
container_name: qbittorrent
environment:
- PUID=1000
- PGID=100
- TZ=Europe/Rome
- WEBUI_PORT=8081
volumes:
- /yacht/AppData/Config/qBittorrent:/config
- /data/Download:/downloads
network_mode: "service:vpn"
depends_on: [ "vpn", ]
restart: unless-stopped
qbittorrent-port-helper:
build: /yacht/AppData/Config/qBittorrent/Scripts
volumes:
- /yacht/AppData/Config/pia:/pia-shared:ro
- /yacht/AppData/Config/qBittorrent/Scripts:/Scripts
network_mode: "service:vpn"
depends_on: [ "vpn", "qbittorrent", ]
This's the content of the Scripts folder:
$ ls -lah /yacht/AppData/Config/qBittorrent/Scripts
total 16K
drwxr-xr-x 2 jorman users 4.0K Jun 4 21:48 .
drwxr-xr-x 5 jorman users 4.0K Jun 3 23:09 ..
-rw-r--r-- 1 jorman users 448 Jun 4 00:01 Dockerfile
-rw-r--r-- 1 jorman users 1.2K Jun 3 23:21 pia-port.sh
This's the content of Dockerfile
# syntax=docker/dockerfile:1
FROM alpine:latest
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && \
echo "http://dl-cdn.alpinelinux.org/alpine/edge/community/" >> /etc/apk/repositories && \
echo "http://dl-cdn.alpinelinux.org/alpine/edge/main/" >> /etc/apk/repositories && \
apk add --no-cache bash curl
ADD pia-port.sh /Scripts/pia-port.sh
RUN chmod +x /Scripts/*.sh
CMD ["/Scripts/pia-port.sh"]
And this's the external build report
$ docker build -t qbittorrent-port-helper /yacht/AppData/Config/qBittorrent/Scripts
Sending build context to Docker daemon 4.096kB
Step 1/5 : FROM alpine:latest
latest: Pulling from library/alpine
540db60ca938: Pull complete
Digest: sha256:69e70a79f2d41ab5d637de98c1e0b055206ba40a8145e7bddb55ccc04e13cf8f
Status: Downloaded newer image for alpine:latest
---> 6dbb9cc54074
Step 2/5 : RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && echo "http://dl-cdn.alpinelinux.org/alpine/edge/community/" >> /etc/apk/repositories && echo "http://dl-cdn.alpinelinux.org/alpine/edge/main/" >> /etc/apk/repositories && apk add --no-cache bash curl
---> Running in c4f79f42602b
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
(1/9) Installing ncurses-terminfo-base (6.2_p20210522-r1)
(2/9) Installing ncurses-libs (6.2_p20210522-r1)
(3/9) Installing readline (8.1.0-r0)
(4/9) Installing bash (5.1.4-r0)
Executing bash-5.1.4-r0.post-install
(5/9) Installing ca-certificates (20191127-r5)
(6/9) Installing brotli-libs (1.0.9-r5)
(7/9) Installing nghttp2-libs (1.43.0-r0)
(8/9) Installing libcurl (7.77.0-r0)
(9/9) Installing curl (7.77.0-r0)
Executing busybox-1.32.1-r6.trigger
Executing ca-certificates-20191127-r5.trigger
OK: 10 MiB in 23 packages
Removing intermediate container c4f79f42602b
---> 637bee3bace5
Step 3/5 : ADD pia-port.sh /Scripts/pia-port.sh
---> 2a632e206586
Step 4/5 : RUN chmod +x /Scripts/*.sh
---> Running in 7076fb43d7f1
Removing intermediate container 7076fb43d7f1
---> 753131d243b3
Step 5/5 : CMD ["/Scripts/pia-port.sh"]
---> Running in b80f230cefc0
Removing intermediate container b80f230cefc0
---> cc954cc47fb4
Successfully built cc954cc47fb4
Successfully tagged qbittorrent-port-helper:latest
But, if I Up the Project I get this error
`Bad Request: build path /yacht/AppData/Config/qBittorrent/Scripts either does not exist, is not accessible, or is not a valid URL.`
So, seems that there's some error with permission of file, so, I copied the Docker file and the script inside Yacht directory, where also is the docker-compose file, here `/var/lib/docker/volumes/yacht/_data/compose/qBittorrent_Pia-Wireguard_Port-Forward` and I modified the build section like this `build: .` to build the Dockerfile that's in the same folder of docker-compose file but also this time the build make error:
Bad Request: Building with native build. Learn about native build in Compose here: https://docs.docker.com/go/compose-native-build/ Creating network "qbittorrent_pia-wireguard_port-forward_default" with the default driver Pulling vpn (thrnz/docker-wireguard-pia:)... Pulling qbittorrent (ghcr.io/linuxserver/qbittorrent:)... Building qbittorrent-port-helper Traceback (most recent call last): File "/usr/bin/docker-compose", line 8, in <module> sys.exit(main()) File "/usr/lib/python3.8/site-packages/compose/cli/main.py", line 80, in main command_func() File "/usr/lib/python3.8/site-packages/compose/cli/main.py", line 192, in perform_command handler(command, command_options) File "/usr/lib/python3.8/site-packages/compose/metrics/decorator.py", line 18, in wrapper result = fn(*args, **kwargs) File "/usr/lib/python3.8/site-packages/compose/cli/main.py", line 1165, in up to_attach = up(False) File "/usr/lib/python3.8/site-packages/compose/cli/main.py", line 1145, in up return self.project.up( File "/usr/lib/python3.8/site-packages/compose/project.py", line 670, in up svc.ensure_image_exists(do_build=do_build, silent=silent, cli=cli) File "/usr/lib/python3.8/site-packages/compose/service.py", line 363, in ensure_image_exists self.build(cli=cli) File "/usr/lib/python3.8/site-packages/compose/service.py", line 1131, in build all_events = list(stream_output(build_output, output_stream)) File "/usr/lib/python3.8/site-packages/compose/progress_stream.py", line 22, in stream_output for event in utils.json_stream(output): File "/usr/lib/python3.8/site-packages/compose/utils.py", line 50, in split_buffer for data in stream_as_text(stream): File "/usr/lib/python3.8/site-packages/compose/utils.py", line 26, in stream_as_text for data in stream: File "/usr/lib/python3.8/site-packages/compose/service.py", line 1880, in build with subprocess.Popen(args, stdout=subprocess.PIPE, File "/usr/lib/python3.8/subprocess.py", line 858, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'docker'
This's a bug or I do some errors?
J
The build should be relative to the path of the project file. So in /config/compose/$projectname is where you'll want to add your stuff and you can use the relative path from there (make sure you're referencing from inside of the container's filesystem and not the host's filesystem.
The sh script use localhost address, maybe I've to change this, I don't know yet, I'm under test, but the Dockerfile point to /Scripts that is mounted inside container (I think is right this)
Ok, I forgot that also Yacht is a container with volumes, so, I copied the Docker file and .sh file inside /var/lib/docker/volumes/yacht/_data/compose/qBittorrent_Pia-Wireguard_Port-Forward
is correct?
But I always have this error:
Bad Request: The projectname variable is not set. Defaulting to a blank string. Building with native build. Learn about native build in Compose here: https://docs.docker.com/go/compose-native-build/ Creating network "qbittorrent_pia-wireguard_port-forward_default" with the default driver Pulling vpn (thrnz/docker-wireguard-pia:)... Pulling qbittorrent (ghcr.io/linuxserver/qbittorrent:)... Building qbittorrent-port-helper Traceback (most recent call last): File "/usr/bin/docker-compose", line 8, in <module> sys.exit(main()) File "/usr/lib/python3.8/site-packages/compose/cli/main.py", line 80, in main command_func() File "/usr/lib/python3.8/site-packages/compose/cli/main.py", line 192, in perform_command handler(command, command_options) File "/usr/lib/python3.8/site-packages/compose/metrics/decorator.py", line 18, in wrapper result = fn(*args, **kwargs) File "/usr/lib/python3.8/site-packages/compose/cli/main.py", line 1165, in up to_attach = up(False) File "/usr/lib/python3.8/site-packages/compose/cli/main.py", line 1145, in up return self.project.up( File "/usr/lib/python3.8/site-packages/compose/project.py", line 670, in up svc.ensure_image_exists(do_build=do_build, silent=silent, cli=cli) File "/usr/lib/python3.8/site-packages/compose/service.py", line 363, in ensure_image_exists self.build(cli=cli) File "/usr/lib/python3.8/site-packages/compose/service.py", line 1131, in build all_events = list(stream_output(build_output, output_stream)) File "/usr/lib/python3.8/site-packages/compose/progress_stream.py", line 22, in stream_output for event in utils.json_stream(output): File "/usr/lib/python3.8/site-packages/compose/utils.py", line 50, in split_buffer for data in stream_as_text(stream): File "/usr/lib/python3.8/site-packages/compose/utils.py", line 26, in stream_as_text for data in stream: File "/usr/lib/python3.8/site-packages/compose/service.py", line 1880, in build with subprocess.Popen(args, stdout=subprocess.PIPE, File "/usr/lib/python3.8/subprocess.py", line 858, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'docker'
Maybe I've to install some extra applications? I only installed docker from official way
J
Sorry bad nob error, I updated the build string with $projectname
, but $projectname
is not set, I don't know how to set it up, but I can manually set the projectname
, but always error:
Bad Request: Building with native build. Learn about native build in Compose here: https://docs.docker.com/go/compose-native-build/ Building qbittorrent-port-helper Traceback (most recent call last): File "/usr/bin/docker-compose", line 8, in <module> sys.exit(main()) File "/usr/lib/python3.8/site-packages/compose/cli/main.py", line 80, in main command_func() File "/usr/lib/python3.8/site-packages/compose/cli/main.py", line 192, in perform_command handler(command, command_options) File "/usr/lib/python3.8/site-packages/compose/metrics/decorator.py", line 18, in wrapper result = fn(*args, **kwargs) File "/usr/lib/python3.8/site-packages/compose/cli/main.py", line 1165, in up to_attach = up(False) File "/usr/lib/python3.8/site-packages/compose/cli/main.py", line 1145, in up return self.project.up( File "/usr/lib/python3.8/site-packages/compose/project.py", line 670, in up svc.ensure_image_exists(do_build=do_build, silent=silent, cli=cli) File "/usr/lib/python3.8/site-packages/compose/service.py", line 363, in ensure_image_exists self.build(cli=cli) File "/usr/lib/python3.8/site-packages/compose/service.py", line 1131, in build all_events = list(stream_output(build_output, output_stream)) File "/usr/lib/python3.8/site-packages/compose/progress_stream.py", line 22, in stream_output for event in utils.json_stream(output): File "/usr/lib/python3.8/site-packages/compose/utils.py", line 50, in split_buffer for data in stream_as_text(stream): File "/usr/lib/python3.8/site-packages/compose/utils.py", line 26, in stream_as_text for data in stream: File "/usr/lib/python3.8/site-packages/compose/service.py", line 1880, in build with subprocess.Popen(args, stdout=subprocess.PIPE, File "/usr/lib/python3.8/subprocess.py", line 858, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'docker'
$projectname in that example is just a placeholder for the folder that your project is in.
Yes you right, reading the error log I see that. I update the docker-file, see last comment, I always get error
@Jorman FileNotFoundError: [Errno 2] No such file or directory: 'docker'
It looks like the docker directory doesn't exist within the project.
I found that running apk add docker-cli
inside the Yacht container fixes this problem.
The error message says No such file or directory: 'docker'
, and I think it means that the docker
executable is missing. I suspect docker-compose executes the docker command line tool (probably calls "docker build"). And the Yacht image doesn't come with it installed.
I’ll go ahead and add that into the image later today. Thanks for the heads up!
Thank you all for the information