Sign inSign up

hmediade/printserver-init

By hmediade

•Updated over 2 years ago

The helper container for printserver to inject all stylesheet files from an external source

Image
0

1.4K

hmediade/printserver-init repository overview

⁠PrintServer Init

This container is a helper for the PrintServer container. It reads all printstyles from an external source and stores those files locally.

⁠Getting Started

The container read files from an external source and stores them into the local folder /stylesheets. The protocols scp and git are implemented to get the files. Git will clone the data via HTTPS only.

After finishing its job, the container terminates.

⁠Prerequisities

In order to run this container you'll need docker installed.

⁠Usage
⁠Container Parameters

Base execution without any parameter:

docker run hmediade/printserver-init:latest

To read files via scp:

docker run --mount type=bind,source=[source path to passwd file],target=/connectiondata \
           --env CONNECTION_TYPE=scp \
           --env STYLESHEET_USERNAME=[username] \
           --env STYLESHEET_PROVIDER=[host|FQDN|IP address] \
           --env STYLESHEET_SOURCEPATH=[source folder] \
           hmediade/printserver-init:latest

To read files via git clone:

docker run --mount type=bind,source=[source path to passwd file],target=/connectiondata \
           --env CONNECTION_TYPE=git \
           --env STYLESHEET_USERNAME=[username] \
           --env STYLESHEET_PROVIDER=[domain] \
           --env STYLESHEET_SOURCEPATH=[URL path] \
           hmediade/printserver-init:latest

To test and inspect the job:

docker run -d --name printserver-test <parameters> hmediade/printserver-init:latest sleep infinity
docker exec -it printserver-test bash
docker kill printserver-test
docker remove printserver-test
⁠Environment Variables
  • CONNECTION_TYPE - scp|git - specifies which protocol is used to retrieve the files
  • STYLESHEET_PROVIDER - Identifies the remote server to get the files from. It could be one of a
    • IP address
    • Hostname
    • FQDN
  • STYLESHEET_SOURCEPATH - The source path to the original files. In case of scp it should be an absolute path on the remote file system. In case of git it is the path segment in the request URL.
  • STYLESHEET_USERNAME- The authority to connect to the remote server.
  • STYLESHEET_PASSWORD - (optional) Used only in case of git, it specifies the password for the user $STYLESHEET_USERNAME to connect to the remote server.
⁠Required Mount
  • /connectiondata - That local path in the container must get a file named password in it with the password of the user $STYLESHEET_USERNAME in clear type. In case of scp, the tool sshpass is used to hand over the password to the scp command. In case of git, the password is extracted into the ENV variable STYLESHEET_PASSWORD, if that ENV variable is not set.
⁠Other File Locations
  • /scripts/import.sh - The job which is executed as CMD when the container executes. Depending on the

  • /stylesheets - The target directory where all imported files will be stored. That should be an external mount point, shared with the main printserver container.

⁠Built With

  • Based on Ubuntu:Latest
  • Built and tested with Microsoft Docker Desktop, Engine v24.0.7
  • Utilizes Git v2.34.1

⁠Find Us

⁠Versioning

Version 1.0.0 Initial release.

We use SemVer⁠ for versioning. For the versions available, see the tags on this repository⁠.

⁠Authors

Tag summary

Content type

Image

Digest

sha256:7f005eb6c…

Size

83.6 MB

Last updated

over 2 years ago

docker pull hmediade/printserver-init