Difference between revisions of "Using the JFileServer Docker Images"
Line 29: | Line 29: | ||
docker stop jfileserver | docker stop jfileserver | ||
− | ==== | + | ==== Using Volume Mapping To Override The Configuration ==== |
+ | The JFileServer Docker image has the following files and folder layout :- | ||
+ | |||
+ | /jfileserver | ||
+ | | | ||
+ | +- /jfileShare | ||
+ | | | ||
+ | +- sharedFile.txt | ||
+ | +- /lib | ||
+ | | | ||
+ | +- bcprov-jdk5on-1.48.jar | ||
+ | +- hazelcast-3.10.1.jar | ||
+ | +- jfileserver-1.1.0.jar | ||
+ | +- jna-5.1.0.jar | ||
+ | +- jna-platform-5.1.0.jar | ||
+ | +- /logs | ||
+ | | | ||
+ | +- jfileserver.log | ||
+ | +- fileSrvConfig.xml | ||
+ | +- runsrv.sh | ||
+ | |||
+ | We can use Docker volume mapping to override the default paths and map them to paths on the host system. To override the default shared folder to a folder on the host system we could use the command :- | ||
+ | |||
+ | docker run -d --rm --name jfileserver -p 445:445 -v <path-to-host-folder>:/jfileserver/jfileShare filesysorg/jfileserver | ||
+ | |||
+ | To have the JFileServer log written to a file on the host we can use the command :- | ||
+ | |||
+ | docker run -d --rm --name jfileserver -p 445:445 -v <path-to-host-folder>:/jfileserver/logs filesysorg/jfileserver | ||
+ | |||
+ | To override the default JFileServer configuration we can map the /jfileserver/fileSrvConfig.xml to a configuration file on the host system :- | ||
+ | |||
+ | docker run -d --rm --name jfileserver -p 445:445 -v <path-to-host-config-file>:/jfileserver/fileSrvConfig.xml filesysorg/jfileserver | ||
+ | |||
+ | Another way to extend the JFileServer image would be to use a Docker file that extends the JFileServer image and copies a new configuration file over the original file. | ||
+ | |||
+ | ==== Using Environment Variables To Override The Configuration ==== | ||
The default configuration can be overridden using environment variables. Also the shared folder and the logs folder can be redirected to use host folders via volume mapping. | The default configuration can be overridden using environment variables. Also the shared folder and the logs folder can be redirected to use host folders via volume mapping. | ||
Revision as of 14:45, 3 January 2019
There are a number of Docker images available with various configurations of the JFileServer. The following Docker images are available :-
Image | Description |
filesysorg/jfileserver | JFileServer file server configured with the SMB server enabled |
filesysorg/jfileserver-db-postgres | JFileServer file server plus the PostGres database filesystem add-on |
filesysorg/jfileserver-enterprise | JFileServer file server plus the Enterprise add-on to add support for SMB2 and SMB3 |
Contents
Using the filesysorg/jfileserver Docker Image
The filesysorg/jfileserver Docker image contains a core JFileServer setup. The default setup enables the SMB server with support for SMB1.
To run the default JFileServer setup use the following command :-
docker run -d --rm --name jfileserver -p 445:445 filesysorg/jfileserver
The Docker image will be downloaded from the Docker hub if you have not already downloaded it. This will start a JFileServer running the SMB server on the native SMB port 445. On linux, macOS and other Unix systems you should be able to connect to the SMB file server by using the host name or IP address in the UNC path when mapping the shared drive path. For example, if the host IP address is 192.168.1.2 you would use a UNC path of \\192.168.1.2\jfileshare to map to the default shared path of the JFileServer. There are two users configured for the file server, an administrator user with the username admin password jfilesrv, and a normal user with username user password java. You will need to use either the admin or normal username and password when connecting to the file server.
To stop the JFileServer use the command :-
docker stop jfileserver
Using Volume Mapping To Override The Configuration
The JFileServer Docker image has the following files and folder layout :-
/jfileserver | +- /jfileShare | +- sharedFile.txt +- /lib | +- bcprov-jdk5on-1.48.jar +- hazelcast-3.10.1.jar +- jfileserver-1.1.0.jar +- jna-5.1.0.jar +- jna-platform-5.1.0.jar +- /logs | +- jfileserver.log +- fileSrvConfig.xml +- runsrv.sh
We can use Docker volume mapping to override the default paths and map them to paths on the host system. To override the default shared folder to a folder on the host system we could use the command :-
docker run -d --rm --name jfileserver -p 445:445 -v <path-to-host-folder>:/jfileserver/jfileShare filesysorg/jfileserver
To have the JFileServer log written to a file on the host we can use the command :-
docker run -d --rm --name jfileserver -p 445:445 -v <path-to-host-folder>:/jfileserver/logs filesysorg/jfileserver
To override the default JFileServer configuration we can map the /jfileserver/fileSrvConfig.xml to a configuration file on the host system :-
docker run -d --rm --name jfileserver -p 445:445 -v <path-to-host-config-file>:/jfileserver/fileSrvConfig.xml filesysorg/jfileserver
Another way to extend the JFileServer image would be to use a Docker file that extends the JFileServer image and copies a new configuration file over the original file.
Using Environment Variables To Override The Configuration
The default configuration can be overridden using environment variables. Also the shared folder and the logs folder can be redirected to use host folders via volume mapping.
As the JFileServer is running in a Docker container it can use the default privileged ports for the various file servers. The SMB server will use TCP ports 139 and 445, and UDP ports 137 and 138, by default. The FTP server will use port 21 by default.
The following environment variables are used :-
Variable Name | Description | Default Value |
JFSRV_SMB_ENABLE | Enable the SMB server | true |
JFSRV_FTP_ENABLE | Enable the FTP server | false |
JFSRV_NFS_ENABLE | Enable the NFS server | false |
JFSRV_SMB_SERVERNAME | Name of the SMB server, for NetBIOS connections | jfilesrv |
JFSRV_SMB_DOMAIN | Domain or workgroup that the SMB server belongs to | domain |
JFSRV_SMB_DIALECTS | SMB dialects that the SMB server will negotiate | SMB1 |
JFSRV_SMB_DEBUGFLAGS | SMB debug flags | Negotiate,Socket,State |
JFSRV_FTP_PORT | Port that the FTP server listens on | 21 |
JFSRV_FTP_DEBUGFLAGS | FTP debug flags | File,Search,Error,DataPort,Directory |
JFSRV_NFS_DEBUGFLAGS | NFS debug flags | File,FileIO |
JFSRV_SHARE_NAME | Shared filesystem name | jfileshare |
JFSRV_SHARE_COMMENT | Comment for the shared filesystem | Test shared filesystem |
JFSRV_ADMIN_USER | Administrator user name | admin |
JFSRV_ADMIN_PASSWORD | Administrator user password | jfilesrv |
JFSRV_NORMAL_USER | Normal user name | user |
JFSRV_NORMAL_PASSWORD | Normal user password | java |
JFSRV_DEBUG_OUTPUT | Debug output destination, 'File' or 'Console' | File |
JFSRV_DEBUG_LOGPATH | Log file path when using 'File' debug output | /jfileserver/logs/jfileserver.log |