docker pull lensesio/lenses
Lenses docker image can be configured via environment variables, or via volume mounts for the configuration files (lenses.conf, security.conf).
lenses.conf
security.conf
Environment variables prefixed with LENSES_ are transformed into corresponding configuration options. The environment variable name is converted to lowercase and undescores (_) are replaced with dots (.). As an example to set the option lenses.port use the environment variable LENSES_PORT.
LENSES_
_
.
lenses.port
LENSES_PORT
Alternatively, the lenses.conf and security.conf can be mounted directly as
Lenses license and connections to external services can be configured through wizard configuration, which will appear at Lenses start up, or via a Lenses provision subcommand.
The license file may be provided to the Docker image via two methods:
See full examples for both configuration options below.
The Docker image exposes four volumes in total, where cache, logs, plugins and persistent data are stored:
/data/storage
/data/plugins
/data/logs
/data/kafka-streams-state
Resides under /data/storage and is used to store persistent data, such as Data Policies. For this data to survive between Docker runs and/or Lenses upgrades, the volume must be managed externally (persistent volume).
Resides under /data/plugins it’s where classes that extend Lenses may be added —such as custom serde, LDAP filters, UDFs for the Lenses SQL table engine and custom_http implementations.
Resides under /data/logs, logs are stored here. The application also logs to stdout, so for most cases, the log files aren’t needed.
Resides under /data/kafka-streams-state, used when Lenses SQL is in IN_PROC configuration. In such a case, Lenses takes advantage of this scratch directory to cache Lenses SQL internal state. Whilst this directory can safely be removed, it can be beneficial to keep it around, so the Processors won’t have to rebuild their state during a restart.
By default Lenses serves connections over plaintext (HTTP). It is possible to use TLS instead, the Docker image offers the ability to provide the content for extra files via secrets, mounted as files or as environment variables. Especially for SSL, the Docker supports SSL/TLS keys and certificates in Java Keystore (JKS) formats.
This capability is optional and users can mount such files under custom paths and configure lenses.conf manually via environment variables, or lenses.append.conf.
lenses.append.conf
There are two ways to use the File/Variable names of the table below.
/mnt/settings
/mnt/secrets
/run/secrets
All settings with the exception of passwords, can be optionally encoded in base64. The docker will detect such encoding automatically.
FILECONTENT_JVM_SSL_TRUSTSTORE
FILECONTENT_JVM_SSL_TRUSTSTORE_PASSWORD
FILECONTENT_LENSES_SSL_KEYSTORE
The docker does not require running as root. The default user is set to root for convenience and to verify upon start up that all the directories and files have the correct permissions. The user drops to nobody and group nogroup (65534:65534) before starting Lenses.
nobody
nogroup
If the image is started without root privileges, Lenses will start successfully using the effective uid:gid applied. Make sure any volumes mounted (i.e. for license, settings, data) have the correct permission set.
You can configure Lenses through the newly introduced wizard. This way Docker configuration to run Lenses becomes pretty straight-forward. See the following docker-compose.yml example on how to deploy lenses.
version: "3.8" services: lenses: image: lensesio/lenses:5.5 environment: LENSES_PORT: 9991 LENSES_SECURITY_USER: admin LENSES_SECURITY_PASSWORD: sha256:8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918 ports: - 9991:9991 - 9102:9102
You could also run:
docker run --name lenses \ -e LENSES_PORT=9991 \ -e LENSES_SECURITY_USER=admin \ -e LENSES_SECURITY_PASSWORD=sha256:8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918 \ -p 9991:9991 \ -p 9102:9102 \ lensesio/lenses:5.5
Lenses will be available at http://localhost:9991. After login, you’ll see the Wizard page.
http://localhost:9991
An alternative option is via a Lenses provision. You can find all the details about constructing the required provisioning.yaml.
provision
The following docker-compose.yml deploys two services, lenses and lenses-provision. The second will read the provision.yaml file and configure all the specified connections and license using Lenses CLI. Container will stop after configuring lenses.
docker-compose.yml
lenses
lenses-provision
provision.yaml
To run the docker-compose, first define a .env file and run: docker-compose up
.env
docker-compose up
# .env LENSES_PORT=9991 LENSES_SECURITY_USER=changeit LENSES_SECURITY_PASSWORD=changeit LENSES_PROVISIONING_PATH=/mnt/provision-secrets
version: "3.8" services: lenses: image: lensesio/lenses:5.5 environment: LENSES_PORT: ${LENSES_PORT} LENSES_SECURITY_USER: ${LENSES_SECURITY_USER} LENSES_SECURITY_PASSWORD: ${LENSES_SECURITY_PASSWORD} LENSES_PROVISIONING_PATH: ${LENSES_PROVISIONING_PATH} ports: - 9991:9991 - 9102:9102 volumes: - ./provisioning.yaml:/mnt/provision-secrets/provisioning.yaml - ./license.json:/mnt/secrets/license.json # - ./files_needed_by_connections_and_used_in_the_provisioning_manifest:/mnt/secrets/certificate.jks
Alternatively both services can be run with docker run.
docker run
First run lenses:
docker run --name lenses \ -e LENSES_PORT=9991 \ -e LENSES_SECURITY_USER=admin \ -e LENSES_SECURITY_PASSWORD=admin \ -p 9991:9991 \ --network lenses-network \ lensesio/lenses:5.5
Once it is up and running, your provisioning configuration will be applied.
On this page