Giter VIP home page Giter VIP logo

docker_programming_station's Introduction

Docker Programming Station

This project provides a simple bash script that one can use to do programming tasks in a Docker environment capturing a standard Ubuntu distribution.

You can simply copy the Dockerfile and run script in any repository. The Dockerfile sets up an image (called by default programming_station-for-yourname). The image is built once when you first call the script. It contains the compilers and build tools. It does not contain your code: your code is meant to go in the current directory. Importantly, the very same image can be used over multiple projects.

Then it passes your command: your command runs in the current directory but within the image. Docker does not copy your code to the image: everything is read and stored in the current directory.

So you can do basic programming tasks:

./run ' gcc --version  '
./run ' git clone https://github.com/simdjson/simdjson.git '
./run ' mkdir build '
./run ' cd build && cmake ../simdjson '
./run ' cd build && cmake --build . '

You can even run perf though you need to know where to find it:

./run ' /usr/lib/linux-tools/5.4.0-26-generic/perf stat ls '

If you just want to enter in a bash shell, you can do so as well:

./run bash

If you like, you can even call the script from a Makefile. It is just a regular bash script.

Features:

  • This works whether you have an ARM-based server or an Intel based mac.
  • The files created in the directory will be owned by you (the user).
  • I works on systems supporting Security-Enhanced Linux.

Caution:

  • The first time you run the script, it builds the image which is an expensive process. It is done only once, however.
  • You should map specific directories insider a user directory. Do you use this script to map system-owned directories like /home/ or /usr/ as it would be unsafe.

Tricks:

  • If you put the run command in your PATH, you will be able to run it from everywhere.
  • A handy command to run from time to time is docker system prune, as it can help you remove unneeded images.

Requirements

  • A working docker installation under Linux, macOS or related system.
  • Bash

docker_programming_station's People

Contributors

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