Skip to main content

Deploy Portainer on a MAC VLAN network

Description

On the previous page I showed how to create a layer 2 macvlan network that allows you to deploye containers in the same network as the host itself. This example will show you how to deploye Portainer CE using the layer 2 macvlan network we created.

Configuration

root@container:~# docker run -d --network L2-Connect --ip=10.128.140.31 --dns=1.1.1.1 --name=Portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest

Once the container has been created you can run the docker container ls command to see the deployed container.

root@container:~# docker container ls

CONTAINER ID   IMAGE                           COMMAND        CREATED          STATUS          PORTS     NAMES

cd30907cabe6   portainer/portainer-ce:latest   "/portainer"   10 minutes ago   Up 10 minutes             Portainer