Jufy111 Posted April 19 Share Posted April 19 (edited) I see far to often, both here and on other forums people asking questions on how get docker applications, that are not available on the community applications page. I know that the answer as available in a few places on this forum, but honesty, it not that easy to find, so I'd though I'd make a guide that I can link people. This guide will hopefully provide enough information to not only get your container up and running, but help you understand how containers are mapped to to your unRAID system. Also I'm happy to admit that I don't know everything, there is a good chance that the way I have done stuff here is not the best way, so feel free to leave feedback to improve this guide. To start off, I'll clarify the nomenclature, as i regularly see people confusing terms. Nomenclature host: In the case of this guide, this host refers to the unRAID server. docker image: Think if this as the template for the docker installation docker container: An instance of a docker image, multiple containers might run from the same docker image persistent data: This is data that is retained (not removed) Interpreting the Docker or Docker compose information for unRAID The image that you are trying to install may have provide a docker run command or docker-compose config in its documentation. These often get a container up and running pretty quick and is usually all that is needed but I would recommend reading any documentation so that you are at least aware of what each part does. I have an example of each below that I have colour coded parts to make it easier. red: Host path/port blue: container path/port green: Environmental Variables purple: Image source grey: my comments, prefixed with # Docker run command Quote docker run -d \ #'-d' just run the command detached, you can ignore this -p 8080:8080 \ #these are not always the same (you might se 8080:80 for example) -v /location/of/trainingData:/usr/share/tessdata \ -v /location/of/extraConfigs:/configs \ -v /location/of/logs:/logs \ -e DOCKER_ENABLE_SECURITY=false \ -e INSTALL_BOOK_AND_ADVANCED_HTML_OPS=false \ --name stirling-pdf \ frooodle/s-pdf:latest You may also find this represented as a single line. Quote docker run -d -p 8080:8080 -v /location/of/trainingData:/usr/share/tessdata -v /location/of/extraConfigs:/configs -v /location/of/logs:/logs -e DOCKER_ENABLE_SECURITY=false -e INSTALL_BOOK_AND_ADVANCED_HTML_OPS=false --name stirling-pdf frooodle/s-pdf:latest Docker-Compose Quote version: '3.3' #part of docker-compose, ignore this services: #part of docker-compose, ignore this stirling-pdf: image: frooodle/s-pdf:latest ports: - '8080:8080' volumes: - /location/of/trainingData:/usr/share/tessdata - /location/of/extraConfigs:/configs - /location/of/customFiles:/customFiles - /location/of/logs:/logs environment: - DOCKER_ENABLE_SECURITY=false - INSTALL_BOOK_AND_ADVANCED_HTML_OPS=false Adding a new docker container to unRAID 1. Scroll to the bottom of the docker tab page in the the unRAID webUI and select "add a new container" Spoiler You can leave many of the fields blank. I'll go over the important ones 2. Name: you can use any name here, or just use the name of the image. 3. Repository: If you are pulling the image from dockerhub, you can just use: '<author>/<repository>:latest' if the docker image you are trying to pull is from the GitHub container registry (ghcr), use: ghcr/author/repository there are also other registries such as linuxserver: lscr/author/repository If you want to use a specific release instead of the latest, specify that instead 4. (these are not always necessary, but may improve the experiance) 4.1. Icon URL: Not a necessity, but its nice to have for the unRAID UI, just link the url to an image you want. 4.2 WebUI: http://[IP]:[PORT:8080] # replace “8080” with the container port (not the host port). This is not necessary; it will allow you to launch the webui by right clicking on the icon from the unRAID webui 4.3 Extra parameters: if there are extra parameters that or not Paths/Ports/Variable you can put them in here. 4.4 Post Arguments: You can most likely ignore. This will run a command on the container startup. You can use it do do things like run script or update packages 4.5 Network Type: Bridge is the default type here, just use it unless you have a reason to use something else. Spoiler free photo host Mapping Paths, Volumes and Environments for the container 5.1 Volumes This maps a directory in the container to a share on your host machine. This data is persistent and remains if the container is updated or removed. One of the directory mappings shown in the docker config is: 'location/of/extraConfigs:/configs'. It shows the host path (red) and the container path (blue) separated by a colon. In this case the host path is shows as 'location/of/extraConfigs', but different authors will all show this differently. You will need to change this to the appropriate share for your unRAID machine. Typically, in unRAID, the 'appdata' share is used for persistent docker container data: '/mnt/user/appdata', then this can be appended with a directory for each container, in this case I am going to call the directory 's-pdf', so the host path is: '/mnt/user/appdata/s-pdf' The right side of the colon, we see the container path: '/configs'. This container path should usually remain unchanged from the example that you find for your image. If you are mapping to other shares that are not appdata, maybe it’s a media folder or maybe it’s a downloads folder, its good practice is to limit the access of the share to the minimum and not just give access to the root of a share. For example, you might have a downloads share /downloads that multiple apps have access to (if you have an application (for example an FTP client), I will map this to a directory '/downloads/ftp-client/' and not the '/downloads/'. To add a mapped path to the container, scroll to the bottom of the add container page and click “Add another Path, Port Variable, Label or Device”The name field is used as identifier, you can really put anything in here, I’m not sure if there is a proper convention for it, I have commonly seen ALL_CAPS used, so that what I will do here. Config Type: Path Name: CONFIG_DIR #can be called anything Container path: '/configs' Host path: '/mnt/user/appdata/s-pdf' Access Mode: Set as required It should look something like this Spoiler Repeat for all the volumes for the image that are required 5.2 Ports Configuring the ports are setup similar to the paths. Left side of the colon is the host (e.g the port you might access a webUI though), the right side is the container. You can change the host port to anything that is already used unless other application need to talk to your new application, then you might have to changes some configs. Leave the container port as it is. Config Type: Port Name: WEBUI_PORT # Call this anything you want Container Port: 8080 #This will be the port number on the right side of the colon. Might not be for you. Host Port: 8080 # you can change this if port 8080 is used by another container Repeat for all ports that are required 5.3 Environments Environments are basically variables that are passed thought to the container, this might be a username, password, or a value that the container uses which which is decided by the user. Left of the equals size is the key, right is the value. Config Type: Variable Name: DOCKER_ENABLE_SECURITY # you can just name this same as the Key Key: DOCKER_ENABLE_SECURITY Value: false Repeat for all variables and then press apply. FAQ Q: Help, I have 2 containers that both use the same port and but I can’t change as I have an application that talks to them over a port. A: setup a bridge connection in the unRAID network settings, this will allow you to use custom bridge network type and set an unique IP address for a container. Q: What if my image is a database that has heavy reads and writes A: instead of a the host path '/mnt/user/appdata/dbcontainername' you can use '/mnt/cache/appdata/dbcontainername'. This bypasses the overhead from the fuse filesystem, which I have found to increases performance. Edited April 24 by Jufy111 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.