gizahNL / moby

Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
https://mobyproject.org/
Apache License 2.0
1 stars 1 forks source link

Build instructions? #8

Open davidchisnall opened 3 years ago

davidchisnall commented 3 years ago

The only things that I can find that look like a build system in the repo seem to assume that I already have working docker tools. How do I do a bootstrap build on FreeBSD?

kit-ty-kate commented 3 years ago

You can use this overlay to build it: https://github.com/decke/ports/tree/master/sysutils/docker-engine

Note that you need to have go installed from ports (not through pkg). Otherwise it won’t compile.

davidchisnall commented 3 years ago

Thanks, I'll give it a try. I'm not sure what this means though:

Note that you need to have go installed from ports (not through pkg). Otherwise it won’t compile.

Ports build packages, pkg then installs them. How do I get a working go for this?

davidchisnall commented 3 years ago

If anyone else finds this and needs step-by-step instructions:

Assuming you have poudriere set up already with the default ports tree called default, first create the overlay:

# poudriere ports -c -m git+https -U https://github.com/decke/ports -p containers

Unfortunately, the current version has the wrong SHA for the containerd port and so you need to fix it, like this:

# cd /usr/local/poudriere/ports/containers/sysutils/containerd
# PORTSDIR=/usr/local/poudriere/ports/default make makesum

This was done with sh as the root shell, if you're still using csh then you'll need to use setenv to set the ports tree location. If you have a ports tree checked out in /usr/ports then a bare make makesum should work.

You can now build the ports:

# poudriere bulk -j ${JAILNAME} -p default -O containers sysutils/docker-engine sysutils/runj

This will create a package repo for you that contains the three containerd-related ports. If you haven't already, you can then add your local repo by creating a /usr/local/etc/pkg/repos/local.conf with the following contents:

local: {
  url: "file:///usr/local/poudriere/data/packages/122amd64-default/",
  enabled: yes
}

You can then simply pkg ins docker-engine and everything is installed.

Replacing poudriere would be a great test for a bunch of this work. A lot of the logic of poudriere is implemented in shell scripts and so should be fairly agnostic to the jail management system (and being able to add caching of container images after the install-build-dependencies step with the containerd snapshotter for sets of ports that have common build dependencies would probably shave a lot of time - installing dependencies dominates the time for a lot of small ports).