Create A Mini File Host for WGET

I needed a way to allow everyone on our local networks to be able to pull files with WGET. I also need the files to be accessible from other docker containers. So, I created this image to make files available via wget but only to our private VPC/VPN.

Created Project in GitLab

I use GitLab to host no just our Git repository but also our docker registry. So I needed to create a Project in order to have a place in the registry for my image.  I did not use the Dockerfile method for this, but I could have.

Project Name: hosted-files

Tomcat Image

I chose Tomcat because I am very familiar with how it works and troubleshooting issues.


docker pull tomcat:7.0


docker tag <image##.

Pushed to GitLab Registry

docker push


Rancher Stack

The next step is to build a stack that uses my image.  So I configured a stack in Rancher for new image.

I used the following docker-compose.yml

  - 80:8080/tcp
    io.rancher.container.pull_image: always
    io.rancher.scheduler.affinity:host_label: name=rancherpool-pvt ## this makes it run on private instances only.
  image:  ## changed this to v2 after image update.
  - /efs/data/hosted-files:/usr/local/tomcat/files ## I have an EFS folder for persistent files.


After I launched the stack, I opened a shell in the running container. I then edited the server.xml file by adding the following to the <host> section.

<Context docBase="/usr/local/tomcat/files" path="/f" />

This tells Tomcat to take the files in the /usr/local/tomcat/files and make them available as:

I then committed the running container to a new image called hosted-files:v2

docker commit <imageid>


Next I created a folder on EFS for Hosted files and copied a file named “test-file.txt” file to it.


I set the folder to be mounted to /usr/local/tomcat/files image:

rancher-hosted-files1Because I am using the Route53 service from the Rancher Catalog, and have opened port 80 on my container, Rancher automatically created a DNS entry for the Hosted Files container

I created a more friendly DNS entry and pointed it to the automatically created name.  CNAME

The file is now available via wget:



Note: I found out about LightTPD afterwards. It would also be a good choice for this project as well. There is also a pre-made docker container for lighttpd here.


Other things that could be done:

  • I could add a Load Balancer and SSL certificate to encrypt the connection.
  • I could have created a Dockerfile and used GitLab to build my image. Perhaps this way I could have passed my change to the server.xml at build time.
Follow by Email

Leave a Reply

Your email address will not be published. Required fields are marked *