Blocks can run in a Docker container using the method described here, based on Debian 12. This article explains how to build and run Blocks as a Docker image. It assumes that you're familiar with Docker and that Docker is installed on the host system.
This is an advanced and unsupported method of running Blocks. If you're not familiar with Docker and the terminal window, you are strongly advised to use our standard Linux server image instead. The Docker-based solution described here only supports the AMD64/x86-64 architecture.
A Docker container cannot directly access physical USB license key. Instead, you have two options:
To allow a Docker container to access a physical license key connected to the host computer (or any other accessible computer running CodeMeter), the license must be shared over the network using the "Server Access" feature of CodeMeter.
The process of enabling the "Server Access" feature differs between Windows and Linux:
On Linux:
service codemeter stop
in a terminal window./etc/wibu/CodeMeter/Server.ini
in a text editor. sudo
is required for making changes to the file.IsNetworkServer=
. Change it from 0
(default) to 1
. Save the file and close the editor.service codemeter start
in a terminal window.On Windows you may use either CodeMeter's Web Admin user interface, or the following command line method:
codemeter /n+
.When building the image, make sure there are no USB license keys connected to the computer. Otherwise, the build process may fail.
docker build -t blocks .
to build the image. This may take some time.To run the image in a Docker container, a few things have to be configured:
echo $UID
in a terminal to see the current users UID. On Windows, use any UID. Please use a UID larger than or equal to 1000.
WARNING: localhost
is not a valid LICENSE_SERVER address (at least when running the container in the default Bridge network mode)! localhost
refers to localhost of the container, not the host computer. Instead, use the IP address or a DNS name, if available.
The previously downloaded and extracted archive contains a docker-compose.yml file. Modify the container configuration in this file according to the descriptions above, then simply run docker compose up
to start a Blocks container. If everything is working, the Blocks editor should be accessible from http://the_host_address:the_host_port/edit.
Below is a sample docker-compose configuration:
services: blocks: image: blocks:latest init: true network_mode: bridge ports: - 8080:8080 volumes: - /home/myuser/blocks-home:/home/blocks environment: - USERID=1000 - LICENSE_SERVER=10.0.1.2 - TZ=Europe/Stockholm
The startup script will download the latest version of Blocks to /home/blocks when the container is started. To use another version of Blocks, simply replace the Blocks executables in /home/blocks from the host system. The startup script will NOT download the latest Blocks version if another version is already present in /home/blocks.