Home

Awesome

Compiles executables of sysinfo, using docker

Provides executables of the sysinfo package, on the host computer, using a docker container to isolate dependencies.

Sysinfo is a Go library providing Linux OS / kernel / hardware system information (as json).

No dependencies are installed on the host computer (except for docker).

To compile executables (for linux 386/amd64) in ./bin/

tl;dr

docker-compose up

Use the executables in ./bin/

Complete Instructions

  1. Install docker (once you see this, you will want docker for other projects)
  2. Clone this repo from https://github.com/mattscilipoti/compile_sysinfo
  3. Go to the repo: cd compile_sysinfo
  4. Run: docker-compose up
  5. The executables are in the ./bin dir on your computer
  6. Run one on a linux system to see a json payload of System Information.

You just compiled go executables without installing anything (except for docker).

Environment Variables

Explanation

The docker image contains all the dependencies needed to run make and compile go. We use docker-compose to setup a shared volume and run make sysinfo within the container. This generates the executables in the host computer's ./bin dir.

! Each run overwrites existing files in ./bin

The environment variables, in the .env file, indicate the executable's architecture and specify the output dir on both the host and container. This provides a single-point-of-truth for info used in the docker-compose.yml and Makefile.

All files in docker_support/ are copied into the WORKDIR of the image (and called within the image).

License

This code is released under the MIT License.