Giter Club home page Giter Club logo

atocker's Introduction

atocker

Atom 1.8 Editor with go-tools bundled in Docker.

Screenshot

This docker image contains atom, go-plus and many go tools. The configuration conforms to a standard GOPATH filesystem layout. Earliear Versions of atocker used the directory layout of gb; with Go 1.6 vendoring is a part of Go itself, so imho it is not needed any more to use sepearate directories for specific projects. If you want gb support, you should start atocker with gb as parametern. In this case, the script will put then /work/vendor directory in the GOPATH and most of the go-tools should work.

You can start the editor in any empty directory and this will be used as the single GOPATH. So if you want to develop for docker it would be ok to have a directory tree like this:

~/development
+--src
   +--github.com
      +--docker
         +-- (clone https://github.com/docker/docker)
   +--bitbucket.org
   ...
+--pkg
+--bin

In this scenario you should set GOPATH to ~/development and your Go tools should work. If this variable is exported it is also possible to use go get ... to fetch the desired Go repositories. No start atocker inside of your ~/development directory.

Vendoring

There are many tools for Go vendoring; the tool inside the container is glide, although it is not needed by the container itself. Please note that glide (or gpm or gvp) is needed outside of the container! When working on a Go project you should add your dependencies with theses tools, so you should not do a go get github.com/fsouza/go-dockerclient because in this case the dependency will be installed in your GOPATH and will be visible for all your projects. You should use glide get github.com/fsouza/go-dockerclient instead (if you use glide); performing this command in your project (which sould be initialized with glide) you will have a directory named vendor which will contain the needed dependency.

This vendor mechanism is now a standard in Go (with 1.5 it was only an experiment); and so it is much easiear to work with one single GOPATH than it was before

Configurtation

Please note: When using the given start script (or alias) the settings and plugins of the editor will be stored in your $HOME/.config/atocker/<workspacepath> directory. All plugins will be in your $HOME/.config/atocker/.atom/packages folder.

Docker Repository on Quay.io

Use the given atocker script to start an instance or create an alias:

_atocker() {
  docker run  \
    --rm \
    -it \
    -v /etc/localtime:/etc/localtime:ro \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -v `pwd`:/work \
    -v $HOME/.config:/config \
    -v $HOME/.gitconfig:/devhome/.gitconfig \
    -v $SSH_AUTH_SOCK:/ssh-agent --env SSH_AUTH_SOCK=/ssh-agent \
    --device /dev/dri \
    -e DISPLAY=$DISPLAY \
    -e LANG=$LANG \
    -e HOSTUSER=`id -un` \
    -e HOSTGROUP=`id -gn` \
    -e HOSTUSERID=`id -u` \
    -e HOSTGROUPID=`id -g` \
    -e WORKSPACE=`pwd` \
    quay.io/ulrichschreiner/atocker "$1"
}
alias gbatom=_atocker gb
alias atm="_atocker"

Note: If you have private repositories where you need your SSH keys, start an agent before starting atocker and add your keys with ssh-add. The agent will be forwarded to the container so the tools to pull inside of atom will work.

Now you can use gbatom to start an atom editor where the needed filesystem layout will be created if it does not exist. You can also use atm to start a Atom editor in the current working directory without creating src and vendor/src directories. When using in go mode, the startup script will also create a symlink in the vendor's package directory so the standard go tools will work. Please do not delete this link!

Included Plugins

Please note: For git you need your correct git configuration. In my example i mount my $HOME/.gitconfig into the container.

See also

If you don't like atom, you should give Visual Studio Code a try.

atocker's People

Contributors

majst01 avatar ulrichschreiner avatar

Watchers

 avatar  avatar  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.