I’m trying to build kolide launcher for linux. Fir...
# kolide
b
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
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.
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.
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)
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?
If you’re building a package, invoke
package-builder
with appropriate options from a host that supports docker.
b
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
This is the file sharing settings in my docker
s
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.
Yes — If you’re cross packaging, you need to specify the pacakge_version. I usually set it to whatever the stable launcher version is.
Have you tried invoking
package-builder make --hostname=fleet:8080 --enroll_secret=my_secret --root_pem=fleet.pem
?
b
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
You may find
package-builder list-targets
interesting
👍 1
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
😲 1