Install additional packages

I’m currently using the ruby environment to run a set or rails services.

I’d like to add an additional library, but it looks like there is no way to install anything via apt-getinto the image. I thought that there is maybe some hook or script that could be invoked to add stuff to the image, but couldn’t find anything.

So it looks like I would need to change the env to docker and add it there. Is there a base-image that could be used to get the same setup, but just add another librarby?

Hi @Peter_Schroder,

There’s currently no way to install system-wide packages unless you use the Docker environment, and we don’t provide a base image.

Depending on the package you want, it may be possible to do a local (not system-wide) installation and include that in your build, but you would have to reference that explicitly in your service. I don’t personally have experience with this, and it may be more trouble than it’s worth.

Out of curiosity, if you’re comfortable sharing, what is the package that you’d like to install?

Ok, thanks.

I’m experimenting with a couple of image-manuplation libraries that require system-packages. So it’s not a package in particular.

I’m running into this same issue. I’m trying to install the twitter-text ruby gem, which depends on idn-ruby which requires the idn library, which does not seem to be installed.

On CI I install it like this: sudo apt-get install libidn11-dev

@dan How would I install the package locally? Just download the binary somewhere? I did find the code below. Any idea how I’d leverage that when using Bundler?

Alternatively, a base image for Docker + Ruby would be useful as well.

gem install --remote --test idn -- \
  --with-idn-lib=/path/to/non/standard/location/lib \
  --with-idn-include=/path/to/non/standard/location/include

Hey @marc!

If you’re looking for a base image, Docker actually provides official Ruby base images that could be helpful, then you could install the library similar to how you’re doing it CI, using a run command in your Dockerfile.

I would recommend going the Dockerfile approach, I’m not too familiar with the with-idn-lib flag, but I don’t believe you could use an uninstalled binary for this.

1 Like