Giter Site home page Giter Site logo

limetext-docker's Introduction

limetext-docker

Dockerfile for development on https://github.com/limetext/lime

Based on the ubuntu 14.04 image. It sets up a new user called 'me' with UID and GID 1000, corresponding to my user on the host so that there will be no trouble with file permissions.

###1. Build the Docker image

$ sudo docker build -t=jobe0900/limebuntu:1 .

Build an image from a Dockerfile in current directory (the last .). The image is called jobe0900/limebuntu, tagged with 1 as a version number.

###2. Create a directory for the limetext source

$ mkdir code

We need to do this on the host so that the directory gets the right permissions

###3. Create an alias for simplifying running the box

(I name my "box" limebuntu, but it can be called anything.)

$ echo "alias limebuntu='sudo docker run -it -v \`pwd\`/code:/home/me --rm jobe0900/limebuntu:1'" >> ~/.bashrc
$ . ~/.bashrc

The flags for the Docker run command is

  • -i interactive,
  • -t tty,
  • -v volumes to sync ($PWD/code on host with /home/me on the container),
  • --rm remove container after use.

This creates a throw away container that is removed after use, but since folders are synced between container and host, changes to those files are persisted.

To start an interactive session with the container (log out with exit):

$ limebuntu

Or to run an one off command:

$ limebuntu /bin/bash -c "ls -la"

###4. Fetch the source

$ limebuntu go get -u github.com/limetext/lime/frontend/...

###5. Update the submodules

$ limebuntu /bin/bash -c "cd \$GOPATH/src/github.com/limetext/lime/ && git submodule update --init"

###6. Build the frontends

$ limebuntu /bin/bash -c "cd \$GOPATH/src/github.com/limetext/lime/frontend/termbox && go build"
$ limebuntu /bin/bash -c "cd \$GOPATH/src/github.com/limetext/lime/frontend/qml && go build"
$ limebuntu /bin/bash -c "cd \$GOPATH/src/github.com/limetext/lime/frontend/html && go build"

###7. Run tests

Backend: Tests fail...

$ limebuntu go test github.com/limetext/lime/backend/...
...
FAIL	github.com/limetext/lime/backend/watch	0.010s

Frontend: Tests pass

$ limebuntu go test github.com/limetext/lime/frontend/...
?   	github.com/limetext/lime/frontend	[no test files]
ok  	github.com/limetext/lime/frontend/html	0.021s
ok  	github.com/limetext/lime/frontend/qml	0.189s
ok  	github.com/limetext/lime/frontend/termbox	0.039s

###8. Run the frontends on the host

Termbox: Ctrl + Q to quit the termbox frontend

$ cd code/src/github.com/limetext/lime/frontend/termbox/
$ ./termbox main.go

QML: Ordinary GUI (works with some flickering)

$ cd ../qml
$ ./qml

HTML: Browse to http://localhost:8080 . Ctrl + C to quit server

$ cd ../html
$ ./html

limetext-docker's People

Watchers

James Cloos avatar

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.