GithubHelp home page GithubHelp logo

ftripier / vim-rust Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mbrt/vim-rust

0.0 2.0 0.0 27 KB

Docker image that bundles rust with vim + plugins

Home Page: https://registry.hub.docker.com/u/mbrt/vim-rust/

License: MIT License

Shell 2.85% Vim Script 97.15%

vim-rust's Introduction

vim-rust

Docker image that bundles Rust lang (with rustc, cargo) and the following vim plugins:

Usage

Run this image from within your workspace. You can than edit your project using vim and usual rust commands: cargo build, cargo test, etc.

cd your/rust/workspace
docker run --rm -tiv `pwd`:/source mbrt/vim-rust

You can also debug by using rust-gdb command. If you have problems with the debugger, see the Troubleshooting section.

Troubleshooting

Debugging inside the container

Default Docker installation (as of version 1.5.0 on Ubuntu 14.04) have problems with gdb (e.g. breakpoints does not work). If you want to use gdb from within the image, you can use the following workaround (under Ubuntu):

  • Install the apparmor-utils package: sudo apt-get install apparmor-utils
  • Enable the complain mode for the docker apparmor config: sudo aa-complain /etc/apparmor.d/docker

This is needed at every reboot. If you want to persist this setting, simply edit /etc/rc.local as root and add this line before exit 0:

aa-complain /etc/apparmor.d/docker

See StevenVanAcker comment on issue #7276 of Docker.

Avoid updating the cargo registry every time a new container is started

Every time you start this image and run cargo build, cargo updates its registry, download your project dependencies and build them. This process is repeated every time you restart the container and could be annoying, especially if you start the image without an internet connection.

A first possibility to avoid that is to cache the .cargo directory in your host machine. Change the run command in this way:

cd your/rust/workspace
mkdir ~/.cargo
docker run --rm -ti -v ~/.cargo:/home/dev/.cargo -v `pwd`:/source mbrt/vim-rust

Another possibility is to create a new image to reuse later, with cached registry:

# on host
cd your/rust/workspace
docker run -tiv `pwd`:/source mbrt/vim-rust
# inside container
cargo update
exit
# on host again
# identify the container id
docker ps -a
docker commit <container-id> myself/myimage

From now on, use your new image:

cd your/rust/workspace
docker run --rm -tiv `pwd`:/source myself/myimage

vim-rust's People

Contributors

ftripier avatar mbrt avatar

Watchers

 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.