timltimmy Jun 17, 2021 @ 4:42am
Dockers
What is a docker and is it useful on a NAS?

Does it use a lot of resources or power ?

Something went wrong while displaying this content. Refresh

Error Reference: Community_9743614_
Loading CSS chunk 7561 failed.
(error: https://community.fastly.steamstatic.com/public/css/applications/community/communityawardsapp.css?contenthash=789dd1fbdb6c6b5c773d)
Showing 1-11 of 11 comments
Omega Jun 17, 2021 @ 8:55am 
Docker is a program which can run containers.

You are probably familiar with virtual machines, a virtual machine is an operating system running on top of an operating system. The virtualized OS could them be running some kind of application seperate from your machine OS such as a web server.

It is huge waste of resources to run an entire OS for a single application or group of applications. It is slow, it takes up huge amounts of processing time and memory, it also takes several minutes to restart if it ever crashes.

Docker runs containers, a container is a bundle of software.

The average Docker container is very crudely build, it contains an entire operating system such as Debian GNU/Linux or Alpine Linux, an entire OS minus hardware related binaries such as the kernel and firmware. Then inside of this container you will have your software installed, such as the Apache web server.
/ # cat /etc/os-release | grep ^NAME NAME="Alpine Linux" / # ls / bin home mnt root srv usr dev lib opt run sys var etc media proc sbin tmp
This codeblock shows me running a grep command inside of the base Alpine Linux container which many people use as a base to build their own containers using Dockerfiles. it also shows the contents of it's root directory, it is an oridnary Linux root file system.

Here is an example of me starting an Ubuntu container, I specifically requested podman to run the container in interactive mode which I can use to run programs inside of the containers and gave it the location of the bash shell I want to use. Podman is almost the same thing as Docker both in usage and capabilities.
╭─dennis@fedora ~ ╰─$ podman run -it --rm ubuntu /bin/bash root@808dd5a95f4c:/# cat /etc/os-release | grep ^NAME NAME="Ubuntu" root@808dd5a95f4c:/# apt -v apt 2.0.5 (amd64) root@808dd5a95f4c:/# apt update Get:1 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB] Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB] Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Inside of this Ubuntu container I can do almost everything I can do on an actual Ubuntu on hardware installation the only limitation being the command line, so no graphical programs, although there are ways around this limitation.

Docker solves the issue VMs have which is the high processing and memory usage, the Docker daemon only runs the software and not a full operating system. The Docker daemon makes use of your actual on-real-hardware operating system.
╭─dennis@fedora ~ ╰─$ podman run -it --rm ubuntu /bin/uname -a Linux da4fa206bd7e 5.12.10-300.fc34.x86_64 #1 SMP Thu Jun 10 14:21:36 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Here is an example of it detecting my Fedora kernel even though this is a Ubuntu container.

When you want to run a container Docker will by default download it from dockerhub. here I am pulling an Apache webserver container from Dockerhub. I specified some ports so I can access the webserver running inside of it. And it told it to automatically delete itself once it stops running.
╭─dennis@fedora ~ ╰─$ podman run -p 8080:80 --rm httpd 125 ↵ Resolved "httpd" as an alias (/home/dennis/.cache/containers/short-name-aliases.conf) Trying to pull docker.io/library/httpd:latest... Getting image source signatures Copying blob 69692152171a skipped: already exists Copying blob aeb67982a725 done Copying blob 7284b4e0cc7b done Copying blob 3678b2d55ccd done Copying blob 06954f8169fd done Copying config 39c2d1c932 done Writing manifest to image destination Storing signatures AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.0.2.2. Set the 'ServerName' directive globally to suppress this message AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.0.2.2. Set the 'ServerName' directive globally to suppress this message [Thu Jun 17 15:38:08.226156 2021] [mpm_event:notice] [pid 1:tid 139790805103744] AH00489: Apache/2.4.48 (Unix) configured -- resuming normal operations [Thu Jun 17 15:38:08.227247 2021] [core:notice] [pid 1:tid 139790805103744] AH00094: Command line: 'httpd -D FOREGROUND'
Now I can browse to http://localhost:8080 and view the "It works!" page which is hosted by Apache running from inside of this container.


Docker is a very broad subject. You can do a lot with docker, automated testing, development, hosting etc.. since it's so quick and easy to replace a container with a new one.
Last edited by Omega; Jun 17, 2021 @ 9:43am
Cathulhu Jun 17, 2021 @ 9:01am 
I have a Docker container on my NAS running, which provides a password manager with a browser based UI.
The whole NAS only uses less than 20% of its 2GB RAM in total.
CPU is literally idling.

Depends on what is run in that container though.
Would be very different if i'd install a Minecraft server container.
Last edited by Cathulhu; Jun 17, 2021 @ 9:02am
timltimmy Jun 17, 2021 @ 9:30am 
Thanks yall! Greatly appreciated!

Sounds really cool dockers!
timltimmy Jun 17, 2021 @ 9:33am 
Stupid question but can you run a docker on Windows 10 ?
Omega Jun 17, 2021 @ 9:38am 
Originally posted by timltimmy:
Stupid question but can you run a docker on Windows 10 ?
Docker on Windows is not comparable to Docker on Linux. On Windows it will use WSL2 as a back-end, WSL is a virtual machine.
Last edited by Omega; Jun 17, 2021 @ 9:42am
Cathulhu Jun 17, 2021 @ 9:41am 
https://docs.docker.com/docker-for-windows/install/
Yes, you can.
It does require WSL2 though.
timltimmy Jun 20, 2021 @ 4:25am 
What is the security of dockers like ?

Can you trust a docker easily from a official source ?
Omega Jun 20, 2021 @ 4:32am 
Originally posted by timltimmy:
What is the security of dockers like ?

Can you trust a docker easily from a official source ?
Docker containers do not have access to your system unless you gave it these permissions. You can also fully block network access if you so desire.

On Dockerhub images are distributed by both the organisations behind the software and random people who build their own image.

Some software projects allow you to build a Docker image from the source code using an included Dockerfile, or they might use Docker to make it easier to build the software without having to go dependency hunting.
Last edited by Omega; Jun 20, 2021 @ 4:34am
timltimmy Jun 20, 2021 @ 4:40am 
Thanks one last question are dockers easy or is it better to not use them if your a noob to them ?

Omega Jun 20, 2021 @ 4:58am 
Originally posted by timltimmy:
Thanks one last question are dockers easy or is it better to not use them if your a noob to them ?
No Docker is not easy. It is something you will have to learn before you can effectively use it.

docker run -d \ --restart unless-stopped \ -v nextcloud:/var/www/html \ -e OVERWRITEHOST="website.com" \ -e OVERWRITEPROTOCOL="https" \ -p 8080:80 \ nextcloud:latest
This is the command I run to setup my Nextcloud container. This is still a simple container which is ready as-is, no need to connect it to other containers, no need to configure a ton of stuff.

Here is an example from my Akeneo container build script, these are all the variables which have to be configured whenever the container is started.
cat <<-EOF > /var/www/akeneo/.env APP_ENV=\\\${APP_ENV} APP_DEBUG=\\\${APP_DEBUG} APP_DATABASE_HOST=\\\${APP_DATABASE_HOST} APP_DATABASE_PORT=\\\${APP_DATABASE_PORT} APP_DATABASE_NAME=\\\${APP_DATABASE_NAME} APP_DATABASE_USER=\\\${APP_DATABASE_USER} APP_DATABASE_PASSWORD=\\\${APP_DATABASE_PASSWORD} APP_DEFAULT_LOCALE=\\\${APP_DEFAULT_LOCALE} APP_SECRET=\\\${APP_SECRET} APP_INDEX_HOSTS=\\\${APP_INDEX_HOSTS} APP_PRODUCT_AND_PRODUCT_MODEL_INDEX_NAME=\\\${APP_PRODUCT_AND_PRODUCT_MODEL_INDEX_NAME} MAILER_URL=\\\${MAILER_URL} AKENEO_PIM_URL=\\\${AKENEO_PIM_URL} APP_ELASTICSEARCH_TOTAL_FIELDS_LIMIT=\\\${APP_ELASTICSEARCH_TOTAL_FIELDS_LIMIT} EOF
Last edited by Omega; Jun 20, 2021 @ 5:00am
timltimmy Jun 20, 2021 @ 5:23am 
Originally posted by Omega:
Originally posted by timltimmy:
Thanks one last question are dockers easy or is it better to not use them if your a noob to them ?
No Docker is not easy. It is something you will have to learn before you can effectively use it.

docker run -d \ --restart unless-stopped \ -v nextcloud:/var/www/html \ -e OVERWRITEHOST="website.com" \ -e OVERWRITEPROTOCOL="https" \ -p 8080:80 \ nextcloud:latest
This is the command I run to setup my Nextcloud container. This is still a simple container which is ready as-is, no need to connect it to other containers, no need to configure a ton of stuff.

Here is an example from my Akeneo container build script, these are all the variables which have to be configured whenever the container is started.
cat <<-EOF > /var/www/akeneo/.env APP_ENV=\\\${APP_ENV} APP_DEBUG=\\\${APP_DEBUG} APP_DATABASE_HOST=\\\${APP_DATABASE_HOST} APP_DATABASE_PORT=\\\${APP_DATABASE_PORT} APP_DATABASE_NAME=\\\${APP_DATABASE_NAME} APP_DATABASE_USER=\\\${APP_DATABASE_USER} APP_DATABASE_PASSWORD=\\\${APP_DATABASE_PASSWORD} APP_DEFAULT_LOCALE=\\\${APP_DEFAULT_LOCALE} APP_SECRET=\\\${APP_SECRET} APP_INDEX_HOSTS=\\\${APP_INDEX_HOSTS} APP_PRODUCT_AND_PRODUCT_MODEL_INDEX_NAME=\\\${APP_PRODUCT_AND_PRODUCT_MODEL_INDEX_NAME} MAILER_URL=\\\${MAILER_URL} AKENEO_PIM_URL=\\\${AKENEO_PIM_URL} APP_ELASTICSEARCH_TOTAL_FIELDS_LIMIT=\\\${APP_ELASTICSEARCH_TOTAL_FIELDS_LIMIT} EOF

Thank You.
Showing 1-11 of 11 comments
Per page: 1530 50

Date Posted: Jun 17, 2021 @ 4:42am
Posts: 11