Running a linux Docker container on your Mac/Win machine

#1

Sometimes when we build the engine we need to run scripts (or build the engine) in a Linux environment. If you’re already on Linux, great.
But for us that don’t use it as default, this tip is for you.

Apart from installing a VM in your favorite VM tool (we use those too!), we also use Docker and its containers.

In our scripts folder, there’s a ./scripts/docker/ folder.
You. can build the container using:

$ ./scripts/docker/build.sh

And you run it like so:

$ ./scripts/docker/run.sh
builder@ubuntu:~$ 

This gives you access to an Ubuntu-18.04 container, with a C++ build tool chain installed. (also Java). See the Dockerfile for details.

It can either take folder as an argument, or you simply run the script from the folder that you wish to be your home directory.

I hope this helps someone!

6 Likes

#2

Actually this is a lifetime saver.
Also there are mobile related stuff there, they could be useful when repacking or deploying(I should check them out)

1 Like

#3

Definitely, we use the repack scripts all the time:

  1. Bundle a test app once
  2. Rebuild engine
  3. Repack bundle with new exe
  4. Test app
  5. Go to 2.

Saves us a lot of time.

1 Like

#4

Yes, definitely a time saver when working on engine features for mobile!

It’s these scripts BTW: https://github.com/defold/defold/tree/dev/scripts/mobile

2 Likes