I created one Docker Image for a custom application which needs some license files (some files and one directory) to run, so I'm using the COPY command in the Dockerfile to copy license file to the image:

# Base image: Application installed on Debian 10 but unlicensed
FROM me/application-unlicensed

# Copy license files
COPY *.license /opt/application/
COPY application-license-dir /var/lib/application-license-dir

I use this Dockerfile to build a new image with the license for a single container. As I have 5 different licenses I created 5 different images each with one specific license file and directory.

The licenses are also fixed to a MAC Address, so when I run one of the five container I specify its own MAC Address with the --mac-address parameter:

docker run --rm --mac-address AB:CD:EF:12:34:56 me/application-license1


As with docker-compose is it possible to specify the container MAC Address, could I just use the unlicensed base image and copy license files and the license directory when I build the 5 containers with docker-compose?

  • 请,带走
    请,带走 回复

    You can set mac_address for the different containers as mac_address: AB:CD:EF:12:34:12. For documentation reference see this


  • fdolor
    fdolor 回复

    According to this commit docker-compose has mac_address support. Mounting license files with -v could be an option.