3

How do I configure Docker on my QNAP TS-131P so that it only uploads one layer at time ?

I have a problem pushing an image because it is trying to push multiple layers concurrently and they keep failing because of a poor internet connection.

According to How to push single docker image layers at time? I need to configure daemon to use max-concurrent-uploads but I don't understand how I do this within the context of qnap.

[~] # docker -v
Docker version 17.09.1-ce, build a9fd393
[~] # which docker
/share/CACHEDEV1_DATA/.qpkg/container-station/bin/docker
Paul Taylor
  • 13,411
  • 42
  • 184
  • 351
  • How did you install docker on it? Knowing that might help find out how to change config. Also docker -v (just in case). – jacob.mccrumb Nov 17 '18 at 13:24
  • I think its just gets installed as part of installing ContainerStation package, then if i sshed to qnap it was available. – Paul Taylor Nov 18 '18 at 17:15
  • Hmm ok. For the record I have never used a qnap device but more then willing to try and help! It does look like docker is installed by ContainerStation, there is a good chance there is a config file out there just need to find out where. Not sure if these preferences are relavent: [ContainerStationReference](https://qnap-dev.github.io/container-station-api/preference.html#get--api-v1-preference-) -- if you can do `which docker` after ssh'ing that might help locate where docker is called from and thus where the config is? – jacob.mccrumb Nov 20 '18 at 03:27
  • @jacob, thanks I have run cmd and added to question. As I did a reboot i can confirm Docker only runs if ContainerStation is installed and has been started.I need to do this in order to build arm version of image. – Paul Taylor Nov 20 '18 at 10:41
  • Okay so can you check for a file: /share/CACHEDEV1_DATA/.qpkg/container-station/script/run-docker.sh -- looks like this might be the script that starts it all. Also if there is a directory /etc/docker then you can follow advice from the original thread with respect to Ubuntu: [daemon.json](https://stackoverflow.com/a/48348339/5585943) – jacob.mccrumb Nov 21 '18 at 02:07
  • If there is a file /share/CACHEDEV1_DATA/.qpkg/container-station/script/run-docker.sh that is calling `dockerd` then you can edit that file and add --max-concurrent-uploads=1 in that line. keep in mind this is a bandaid and each time you update container-station its possible you'll have to hop back in and re-add it – jacob.mccrumb Nov 21 '18 at 02:10
  • @jacob.mccrumb hi, so both files exist, I have created a daemon.json file and then restarted docker, by stopping and restarting container station, files still exists after restart so hopefully this works. – Paul Taylor Nov 21 '18 at 10:44
  • Sounds good! If that doesn't work check contents of /share/CACHEDEV1_DATA/.qpkg/container-station/script/run-docker.sh -- from the name I am guessing that is what starts up `dockerd` and that accepts command line arguments, including the --max-concurrent-uploads – jacob.mccrumb Nov 21 '18 at 15:10
  • okay, if you add answer I can award bounty – Paul Taylor Nov 22 '18 at 13:32
  • Excellent, glad we were able to figure it out (and wish I knew this a year ago because I would often crash my poor network when I was pushing docker containers...) – jacob.mccrumb Nov 22 '18 at 15:07

1 Answers1

5

After much digging,

Looks like container-station is using same location as Linux systems for dockerd config file. Should work by adding a file:

/etc/docker/daemon.json with:

{ "max-concurrent-uploads": 1 }

from how-to-push-single-docker-image-layers-at-time

Alternatively, if the script for starting up docker used by container station (/share/CACHEDEV1_DATA/.qpkg/container-station/script/run-docker.sh) has a line including dockerd, you could add the command line argument --max-concurrent-uploads=1 to that line.

jacob.mccrumb
  • 681
  • 5
  • 18