Skip to content

Containers

Southclaws edited this page Jun 1, 2018 · 5 revisions

You can use sampctl to execute your Package (pawn.json/pawn.yaml) inside a Docker Container.

What is a Docker Container?

Docker is a technology for creating and running portable and isolated applications. It's used heavily in cloud technology to facilitate portable, stateless applications.

It's also a fantastic development tool for "simulating" other environments. It's similar to virtualisation but without the added layer of abstraction of "host" and "guest" operating systems.

What this means is you can execute the SA:MP server on any platform and it will run as if it's in a Linux environment.

This means you can use Windows or Mac to:

  • Develop and run Pawn code on platforms that won't execute samp03svr such as OS X
  • Test Linux compatibility
  • Use Linux-only plugins

Usage

To run a package in a container, simply use the --container flag:

sampctl package run --container

If your server or package declare plugins as dependencies, they will always be downloaded by default inside the container because the container has its own cache located at /root/.samp/ - in order to circumvent this and use your local machine cache, pass the --mountCache flag.

Stability

This feature isn't considered stable yet. I personally use it frequently to develop Pawn Packages on my Macbook however it's not recommended for production use.

If you are interested in running a production server in a Docker container, you can use FROM southclaws/sampctl and build your own Docker image that uses sampctl. The sampctl base image contains all the necessary packages for running the SA:MP server itself.

Clone this wiki locally