Giter VIP home page Giter VIP logo

devenv's Introduction

VS Code Devcontainer and Docker Image for Coding in R, Python, and Latex

Obtain the latest stable image with:

docker pull ghcr.io/berrij/devenv:latest

Introduction

This Ubuntu-based docker image intends to deliver a fully isolated dev environment for Python, R and Latex. Extend it as needed by adding or removing components.

It is intended that you use this image with a VS Code Devcontainer. VS Code will automatically install all required extensions for code formatting, linting, execution, and debugging.

Contents

  • R 4.X.X
  • Texlive 2022
  • Python 3.8.X

Setup using VS-Code

System requirements

Getting Started

  • Fork the berrij/devenv github repository.
  • Clone the forked repository.
  • Open the repository inside VS Code and install the recommended extensions.
  • VS Code should ask you if you want to reopen the workspace in a container. It will automatically download the latest master build, install extensions, and mount your current workspace.

SSH and GPG Keys

Look here on how to forward your local keys into the container.

Without VS-Code:

You may need to run:

xhost local:root 

locally to grant access to the local x11 display server. This is necessary for R graphics devices to work.

Run using:

docker run -it --rm --network=host -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix ghcr.io/berrij/devenv:dev

Explanation:

-it             
# Interactive Mode, launches a shell

--rm            
# Automatically remove the container when it exits

--network=host  
# Configures the network of the Docker container to use   the host network. This is the simplest way to get access to X11

-e DISPLAY      
# Sets the DISPLAY variable to :0. Works ins most cases.

-v /tmp/.X11-unix:/tmp/.X11-unix dev_env:latest
# Mounts the local .x11 server into the container

Remove Old Docker Images

You can check the disk usage of Docker by running:

docker system df

You likely want to add a cronjob to delete old docker images and containers. You can do so the following way:

Edit your crontab with:

crontab -e

Then add the following line:

0 18 * * 5 /usr/bin/docker system prune --all --volumes --force

This will remove all unused images not just dangling ones as long as they are older than 10 days.

When using this image with the .devcontainer.json as a devcontainer, a local volume extensions_cache / extensions_cache_insiders will be created for storing container extensions between container runs. If extensions are updated in the .devcontainer.json this volume has to be deleted:

docker volume rm extensions_cache
docker volume rm extensions_cache_insiders

Issues

If you encounter issues or you want to propose a feature feel free to open an issue on GitHub.

devenv's People

Contributors

berrij avatar dependabot[bot] avatar

Stargazers

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