Sign inSign up

mgoltzsche/liteide

By mgoltzsche

•Updated 6 months ago

LiteIDE containerized: A fast reproducible Go development environment

Image
0

3.0K

mgoltzsche/liteide repository overview

⁠LiteIDE Docker image

A LiteIDE⁠ redistribution as Docker⁠ container image providing a fast, portable, reproducible Go⁠ development environment.

⁠Usage

This image can be run using the launcher script liteide.sh or using Docker directly.

⁠Install the launcher script

Install the launcher script on your host:

curl -fsSL https://raw.githubusercontent.com/mgoltzsche/liteide-docker/master/liteide.sh -o /tmp/run-liteide &&
chmod +x /tmp/run-liteide &&
sudo mv /tmp/run-liteide /usr/local/bin/run-liteide
⁠Launcher script usage

The launcher can be used as follows:

run-liteide PROJECTDIR [PACKAGE]
ArgumentDescription
PROJECTDIRThe project directory that should be opened with LiteIDE
PACKAGEOptional: the package your PROJECTDIR should be mounted to
Environment variableDescription
LITEIDE_INIPath to a liteide.ini file that should be used. Default: $PROJECTDIR/liteide.ini
LITEIDE_VERSIONLiteIDE version
LITEIDE_IMAGEfull LiteIDE Docker image name (overwrites LITEIDE_VERSION)
LITEIDE_CACHEif set to on the directory .liteide-cache is mounted to the container's GOPATH
⁠Using Docker directly (optional)

In order to run a container using this image directly you need to provide several options:

  • provide your host UID/GID as CHOWN environment variable in order to run LiteIDE as your user (not required when using podman⁠)
  • pass through your host's DISPLAY environment variable
  • mount your host's /etc/machine-id
  • mount your project directory into the container's /go directory (GOPATH points to /go)
  • optionally you can also mount your project's liteide.ini to /tmp/liteide/.config/liteide/liteide.ini within the container (see liteite-example.ini)

Example:

docker run --name liteide --rm \
	-e CHUSR=$(id -u):$(id -g) \
	-e DISPLAY="${DISPLAY}" \
	--mount type=bind,src=/tmp/.X11-unix,dst=/tmp/.X11-unix \
	--mount type=bind,src=/etc/machine-id,dst=/etc/machine-id \
	--mount "type=bind,src=${PROJECTDIR:-.},dst=/go/src/github.com/example/project" \
	mgoltzsche/liteide:latest \
	/go/src/github.com/example/project
⁠LiteIDE usage

This section explains how to manage LiteIDE's build configuration.

In order to build the whole project independent of your currently opened file and with the root package's BUILDFLAGS you may want to lock the build path as follows:

  • Using the root package's context menu select Build Path Configuration
  • Configure the BUILDFLAGS variable if required
  • Lock Build Path to the top-level directory

If you want keep your configuration across IDE restarts or ship it with your project you need to enter the LiteIDE Docker container and copy /opt/liteide/home/.config/liteide/liteide.ini to your project dir at ./.liteide.ini.

⁠License

  • This project (Docker build + script): Apache License 2.0
  • LiteIDE⁠: GNU Lesser General Public License v2.1

Tag summary

Content type

Image

Digest

sha256:e9403c480…

Size

462.2 MB

Last updated

6 months ago

docker pull mgoltzsche/liteide