Difference between revisions of "How To Use Docker Toolbox With MPB"
m (Added a few distinctions between the image/container building for the Duo vs the Duo X to make it more clear and consistent) |
|||
Line 47: | Line 47: | ||
After that you can chose to either create an image for compiling plugins for the DUO, or for the DUO X. | After that you can chose to either create an image for compiling plugins for the DUO, or for the DUO X. | ||
− | To create a | + | To create a DUO image run: |
<source lang="console"> | <source lang="console"> | ||
$ docker build -t modduo-plugin-builder --build-arg platform=modduo . | $ docker build -t modduo-plugin-builder --build-arg platform=modduo . | ||
</source> | </source> | ||
− | Or to create a | + | Or to create a DUO X image run: |
<source lang="console"> | <source lang="console"> | ||
$ docker build -t modduox-plugin-builder --build-arg platform=modduox . | $ docker build -t modduox-plugin-builder --build-arg platform=modduox . | ||
Line 59: | Line 59: | ||
After it's done, we create and run a container from modduo-plugin-builder or modduox-plugin-builder: | After it's done, we create and run a container from modduo-plugin-builder or modduox-plugin-builder: | ||
− | For | + | For DUO: |
<source lang="console"> | <source lang="console"> | ||
$ docker run -ti --name mdpb -p 9000:9000 -v ~/local-modduo-folder:/tmp/local-modduo-folder modduo-plugin-builder | $ docker run -ti --name mdpb -p 9000:9000 -v ~/local-modduo-folder:/tmp/local-modduo-folder modduo-plugin-builder | ||
$ exit | $ exit | ||
</source> | </source> | ||
− | Or for | + | Or for DUO X: |
<source lang="console"> | <source lang="console"> | ||
$ docker run -ti --name mdxpb -p 9000:9000 -v ~/local-modduox-folder:/tmp/local-modduox-folder modduox-plugin-builder | $ docker run -ti --name mdxpb -p 9000:9000 -v ~/local-modduox-folder:/tmp/local-modduox-folder modduox-plugin-builder | ||
Line 72: | Line 72: | ||
That's it. The command to start the modduo-plugin-builder or modduox-plugin-builder environment is: | That's it. The command to start the modduo-plugin-builder or modduox-plugin-builder environment is: | ||
− | For | + | For DUO: |
<source lang="console"> | <source lang="console"> | ||
$ docker start -i mdpb | $ docker start -i mdpb | ||
</source> | </source> | ||
− | Or for | + | Or for DUO X: |
<source lang="console"> | <source lang="console"> | ||
$ docker start -i mdxpb | $ docker start -i mdxpb |
Revision as of 21:05, 11 March 2020
Introduction
This is a quick start guide to get the mod-plugin-plugin working inside docker, running in Windows or MacOS.
If you're not using Linux please install Docker Toolbox, so you can access docker from within a nice pre-setup VM for it.
Pre-compiled image
NOTE: The current pre-compiled image can only compile plugins for the Duo. There will be a new pre-compiled version available soon that can build plugins for both Duo and Duo X. At this moment (May 29th, 2019), there are Docker files available that can build plugins for both platforms but these are not pre-compiled (see section "Full build (advanced, long)" below)
After you install and run docker toolbox you should be presented with a command-line interface.
This console is actually running Linux inside a virtual machine, but without you having to do any configuration or setup.
To begin, we download the pre-compiled mod-plugin-builder docker image by running:
$ docker run -ti --name mpb -p 9000:9000 moddevices/mod-plugin-builder
If you wish to have a local folder accessible inside the docker environment, use the '-v' argument with the local and docker mapped folder joined by a semi-colon. Like this:
$ docker run -ti --name mpb -p 9000:9000 -v ~/local-mod-folder:/tmp/local-mod-folder moddevices/mod-plugin-builder
Some notes:
- The image size is around 1Gb, split across several files.
- The previous commands will create a new docker environment every time you run them. You only need them once.
After you close the console window, you can resume where you left off by running:
$ docker start -i mpb
Full build (advanced, long)
If you don't want to use a pre-compiled image, you can build mod-plugin-builder yourself. To begin, start docker and navigate to the docker directory:
$ git clone --depth 1 https://github.com/moddevices/mod-plugin-builder
$ cd mod-plugin-builder/docker
After that you can chose to either create an image for compiling plugins for the DUO, or for the DUO X.
To create a DUO image run:
$ docker build -t modduo-plugin-builder --build-arg platform=modduo .
Or to create a DUO X image run:
$ docker build -t modduox-plugin-builder --build-arg platform=modduox .
NOTE: This will take quite some time...
After it's done, we create and run a container from modduo-plugin-builder or modduox-plugin-builder:
For DUO:
$ docker run -ti --name mdpb -p 9000:9000 -v ~/local-modduo-folder:/tmp/local-modduo-folder modduo-plugin-builder
$ exit
Or for DUO X:
$ docker run -ti --name mdxpb -p 9000:9000 -v ~/local-modduox-folder:/tmp/local-modduox-folder modduox-plugin-builder
$ exit
That's it. The command to start the modduo-plugin-builder or modduox-plugin-builder environment is:
For DUO:
$ docker start -i mdpb
Or for DUO X:
$ docker start -i mdxpb
You can find more information about docker here.