Docker

This page will briefly show you how to work with the Lenses Docker image from the UNIX command line.

The Lenses Docker image

If you have your Lenses ID, you are ready to execute the Lenses Docker image:

docker run --name=lenses-dev \
    -e ADV_HOST=127.0.0.1 \
    -e EULA="https://dl.lenses.stream/d/?id=YOUR_ID_HERE" \
    --rm -p 3030:3030 \
    -p 9092:9092 \
    -p 2181:2181 \
    -p 8081:8081 \
    -p 9581:9581 \
    -p 9582:9582 \
    -p 9584:9584 \
    -p 9585:9585 \
    landoop/kafka-lenses-dev

Please do not forget to put your own Lenses ID in the docker run command and have in mind that you will have to wait a little bit for the Lenses Box Docker image to fully load its services.

If you want to start Lenses Box without including the sample data that come with it, you should begin it as follows:

docker run --name=lenses-dev \
    -e ADV_HOST=127.0.0.1 \
    -e EULA="https://dl.lenses.stream/d/?id=YOUR_ID_HERE" \
    --rm -p 3030:3030 \
    -p 9092:9092 \
    -p 2181:2181 \
    -p 8081:8081 \
    -p 9581:9581 \
    -p 9582:9582 \
    -p 9584:9584 \
    -p 9585:9585 \
    -e SAMPLEDATA=0 landoop/kafka-lenses-dev
    landoop/kafka-lenses-dev

The difference comes from the use of -e SAMPLEDATA=0 in the docker run command.

You can stop the Lenses Box Docker image from running by pressing Control+C.

Making sure everything works

There exist many ways for making sure that everything works as expected.

You can connect to the Kafka server inside the container and replay the records of a given topic as follows:

docker exec -it lenses-dev \
    kafka-console-consumer \
    --bootstrap-server localhost:9092 \
    --topic cc_data \
    --from-beginning

The key point here is the use of --from-beginning, which tells Kafka to print out all the messages for the given topic. If you are interested in new records only, you should omit --from-beginning from the command.

You can begin a bash shell inside the Docker container as follows:

docker exec -it lenses-dev bash
First login. Configuring lenses-cli.

Last, you can list the available Kafka topics as follows:

docker exec -it lenses-dev kafka-topics --zookeeper localhost:2181 --list

All previous commands assume that the name of your Docker image is lenses-dev. If you have used a different name, please make the necessary changes to the presented shell commands.

Updating the Lenses Docker image

Lenses gets updated as new features are added. Therefore, it is good to always have the latest version of the Lenses Box. The easiest way to get the latest Docker image is to execute the next command:

docker pull landoop/kafka-lenses-dev

Now it is a good time to login to your Lenses Box in order to be able to follow what we are going to talk about. So, please go to http://localhost:3030 and login.