Skip to content

jsosic/docker-ocsinventory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-ocsinventory

Dockerized OCSInventory Server.

Rationale

Although there is already an official image for OCS Inventory Server, it's deviating from Docker's best practices, and can pose a challenge to run in a production environment.

Major problem with the state of the original image at the time of the writing of this document is that it installs OCS upon the initial start of the container, as seen in the entrypoint script.

This is making it very hard to extend this image in any sensible way.

Motivation behind this project is to provide an image that's not suffering from the same flaws as the official one.

Pulling image

docker pull jsosic/ocsinventory:2.6

Building image

make build

Running image

The container accepts the following environment variables:

  • OCS_DBSERVER_WRITE - MySQL master host - the one which can accept write queries.
  • OCS_DBSERVER_READ - MySQL slave host, where read queries will be sent. It can be master.
  • OCS_DBNAME - MySQL database name. Defaults to ocsweb.
  • OCS_DBUSER - MySQL user. Defaults to ocs.
  • OCS_DBPASS - MySQL user password.

Note: MySQL is expected to run on port 3306. This image doesn't currently support custom port number.

Dependencies

Install MySQL

Any kind of MySQL server is supported: no matter the locally installed, remote MySQL or a docker one.

Once you have a MySQL up and running, creating a database and adding a user is a neccessity:

# mysql
> CREATE DATABASE ocsweb;
> CREATE USER 'ocs'@'%' IDENTIFIED BY 'ocs';
> GRANT ALL PRIVILEGES ON ocsweb.* TO 'ocs'@'%' WITH GRANT OPTION;
> FLUSH PRIVILEGES;

Upgrading

Upgrading to a new OCS Inventory is as simple as pulling and running the latest image (or use a specific tag). Once you open the /ocsreports URI, an option to run the database upgrade will be presented.

Known issues

This container runs apache2, which may be considered suboptimal, but is the most convenient way to run OCS.

About

Dockerized OCS Inventory

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published