Packaging Go application for Debian

后端 未结 5 616
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-30 05:32

How can I put my Go binary into a Debian package? Since Go is statically linked, I just have a single executable--I don\'t need a lot of complicated project metadata information

5条回答
  •  抹茶落季
    2021-01-30 06:03

    Building deb or rpm packages from Go Applications is also very easy with fpm.

    Grab it from rubygems:

    gem install fpm
    

    After building you binary, e.g. foobar, you can package it like this:

    fpm -s dir -t deb -n foobar -v 0.0.1 foobar=/usr/bin/
    

    fpm supports all sorts of advanced packaging options.

提交回复
热议问题