1

I have recently tried out Gitpod, which seems to be a quite cool tool.

For testing purposes, I have opened some C++ GitHub repository of mine that uses Boost (among other libraries). Unfortunately, Boost does not seem to be installed in the Docker image, so my code does not compile.

I know about the possibility of creating own Docker images, but I was wondering if there are alternative, easier options as well. Does Gitpod provide any Environment Modules-like option to dynamically load/unload certain "commonly used" libraries or do I always have to provide my own Docker instance in this case?

andreee
  • 4,459
  • 22
  • 42
  • 1
    A good way is to use gitpod config file, .gitpod.yml. You can refer to the section "Update Flutter dependencies in a Gitpod config file" in this post https://medium.com/@jacksonzhou666_71188/gitpod-flutter-productivity-on-the-go-for-mobile-app-developers-cc2495049d52 – Tianhao Zhou Oct 15 '19 at 21:12
  • Or, you can use Ubuntu for base image on Dockerfile like [I've done for running old Ruby 2.3.8 and Heroku CLI](https://github.com/kevinhq/gitpod-dockerfile-collections/blob/master/.ruby-2.3.6-with-heroku.Dockerfile). – kevin Apr 01 '20 at 10:04

1 Answers1

4

I work on Gitpod. Thank you for trying it and the compliment :)

We didn't want to invent yet another module system for Gitpod.

Instead, we decided to support Dockerfiles and build them on-demand, because Dockerfiles allow using all those amazing module systems that are already out there: Debian's packages, Alpine's packages, Node Version Manager (NVM), Ruby Version Manager (RVM), SDKman, etc. Basically any Linux-compatible package manager down to simple wget.

You can also use own Docker images, but I find Dockerfiles more convenient because you can check them into git and thereby version them together with your source code. It's dev-environment-as-code and should be shared across the team. Also, you don't need to bother with building and pushing them to a registry (e.g. hub.docker.com).

What Gitpod does offer, hoever, is a selection of Docker images (src). The most prominent one is gitpod/workspace-full, which it Gitpod's default image.

To get back to your question about the easiest way to get the right modules into your Gitpod development environment:

  1. inheriting from gitpod/workspace-full is very convenient.
  2. If you don't want (2), copy'n'pasting sections from gitpod/workspace-full is convenient.
  3. Often, putting RUN apt-get update && apt-get install -y libboost-all-dev into your Dockerfile is enough. This is APT to install the package libboost-all-dev.
  4. Most software projects have documentation on how to build them under Linux. These instructions usually work in Dockerfiles, too.
  5. Search on hub.docker.com for useful Docker images. You can inherit from those images or find their Dockerfiles and copy'n'paste sections from there.
Moritz Eysholdt
  • 741
  • 7
  • 4
  • How does one make the changes in Dockerfile to become active? I tried adding `apt-get install ngrep` to .gitpod.Dockerfile and committed the change but nothing happened. – Henno Sep 03 '20 at 16:36