Title
#kolide
Bacarus

Bacarus

02/19/2021, 4:07 PM
I’m trying to build kolide launcher for linux. First the dockerfile doesn’t work as I expected but with fews changes it builds the linux version. I’ve changed:
RUN GO111MODULE=on go run cmd/make/make.go -targets=launcher,extension -linkstamp $FAKE
with this:
RUN GO111MODULE=on go run cmd/make/make.go -targets=launcher,osquery-extension.exe -linkstamp $FAKE
and
RUN cp build/linux/* /usr/local/kolide/bin/
with this
RUN cp build/linux.amd64/* /usr/local/kolide/bin/
I’ve taken a look at kolide/fpm but I don’t understand very well how it works. What should I do if I want a simple rpm to deploy to hosts and how can I configure the launcher? (I’d like to build an rpm package that it will be launched at the startup like the msi for windows)
s

seph

02/19/2021, 11:05 PM
kolide/fpm
is used internally by package-builder when it’s building for rpm/deb/pacman. It’s not something you would call on your own.
11:06 PM
The linux packaging has to run on a host that supports docker. I use macOS. linux would probably work. windows might, never tried windows and docker.
11:06 PM
If you’re packaging. I would not recommend going near the dockerfile. (You[re probably right, that it has an error, but it shouldn’t matter)
11:08 PM
So, building launcher for linux woud generally be done via cross compiling the go.
make build_launcher_linux
should work. But I don’t know if you’re trying to build launcher, or just a package?
11:08 PM
If you’re building a package, invoke
package-builder
with appropriate options from a host that supports docker.
Bacarus

Bacarus

02/22/2021, 1:43 PM
Thank you a lot for your help. I think I have figured it out. running this command
package-builder make --hostname=fleet:8080 --enroll_secret=my_secret --root_pem=fleet.pem --output_dir=. -targets linux-launchd-rpm
I have this error message:
run command /var/folders/z8/lhzyngpx57l42hr3qkq4fm1w0000gn/T/package.packageRoot989424315/usr/local/launcher/bin/launcher [-version], stderr=: fork/exec /var/folders/z8/lhzyngpx57l42hr3qkq4fm1w0000gn/T/package.packageRoot989424315/usr/local/launcher/bin/launcher: exec format error
And the rpm output package is empty. should I add -package_version flag? which value should I give to have the most latest version? By the way the docs is a little bit tricky to me. Adding some other examples (especially about cross compiling) to the documentation can make it easier to understand
1:55 PM
This is the file sharing settings in my docker
s

seph

02/22/2021, 1:58 PM
pacakge-builder
and, to be honest, much of the launcher tooling expects a fairly deeop knowledge of OS management and packaging. If you need a lot of support, or ready made things, there are several commercial vendors.
1:59 PM
Yes — If you’re cross packaging, you need to specify the pacakge_version. I usually set it to whatever the stable launcher version is.
2:00 PM
Have you tried invoking
package-builder make --hostname=fleet:8080 --enroll_secret=my_secret --root_pem=fleet.pem
?
Bacarus

Bacarus

02/22/2021, 5:03 PM
Yes, in that way I build the pkg installer. I’ve already made the pkg for mac os and the msi for windows and they work as expected. By the way I’ve found the error I used linux-launchd-rpm instead of linux-systemd-rpm and now it works. Thank you for your help seph, I’m sorry for wasting your time. I don’t have a lot of experience and I’m trying to learn.
s

seph

02/22/2021, 5:04 PM
You may find
package-builder list-targets
interesting
5:05 PM
If you’re packaging on macOS, you can specify multiple targets. I would normally use
-targets darwin-launchd-pkg,linux-systemd-rpm,linux-systemd-deb
for example