Giter Site home page Giter Site logo

mgoltzsche / liteide-docker Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 2.0 59 KB

LiteIDE containerized: A fast reproducible Go development environment

License: Apache License 2.0

Dockerfile 52.12% Makefile 11.69% Shell 36.19%
liteide ide go golang docker container-image container containerized

liteide-docker's Introduction

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]
Argument Description
PROJECTDIR The project directory that should be opened with LiteIDE
PACKAGE Optional: the package your PROJECTDIR should be mounted to
Environment variable Description
LITEIDE_INI Path to a liteide.ini file that should be used. Default: $PROJECTDIR/liteide.ini
LITEIDE_VERSION LiteIDE version
LITEIDE_IMAGE full LiteIDE Docker image name (overwrites LITEIDE_VERSION)
LITEIDE_CACHE if 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

liteide-docker's People

Contributors

mgoltzsche avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jk128 alexspiter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.