Coder Social home page Coder Social logo

xeddmc / karton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from karton/karton

0.0 2.0 0.0 306 KB

Karton - Run Linux programs on macOS, a different Linux distro, or a different architecture

Home Page: https://karton.github.io/

License: Other

Makefile 1.45% Python 95.13% Shell 3.42%

karton's Introduction

[Web site] – [Install] – [How to use] – [FAQ] – [Contribute]

Karton

Karton is a tool to transparently run Linux programs on macOS or on another Linux distro.

$ uname -a # Show we are running on macOS.
Darwin my-hostname 16.4.0 Darwin Kernel Version 16.4.0 [...]

$ # Run the compiler in the Ubuntu image we use for work
$ # (which we called "ubuntu-work"):
$ karton run ubuntu-work gcc -o test_linux test.c

$ # Verify that the program is actually a Linux one.
$ # The files are shared and available both on your
$ # system and in the image:
$ file test_linux
test_linux: ELF 64-bit LSB executable, x86-64, [...]

$ # Same thing but on 32-bit ARMv7 (in the image we
$ # called "ubuntu-work-arm"):
$ karton run ubuntu-work-arm gcc -o test_arm test.c
$ file test_arm
test_arm: ELF 32-bit LSB executable, ARM, EABI5 [...]

$ # We can run the ARM program:
$ karton run ubuntu-work-arm ./test_arm
[... Output of our program ...]

In another terminal you can attach to the running program and debug it.

$ # Find the PID of the test_arm program.
$ karton run ubuntu-work-arm ps aux | grep test_arm
test_arm    42  [...]  test_arm

$ # Debug it!
$ karton run ubuntu-work-arm gdb --pid 42
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
[...]
Attaching to process 11
[...]
0x00007f53430e4740 in __nanosleep_nocancel () at ../sysdeps/unix/syscall-template.S:84
84	../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb)

In the example, by prefixing your commands with karton run ubuntu, you can run them on Ubuntu even if you are using macOS (or another Linux distro!). Files are shared across the two operating systems and executing commands like this is very fast, making the whole experience smooth.

Karton uses Docker 🐳 to create a semi-permanent container where all the commands are executed. The management of this container is transparent to the user, who doesn't need to worry about the Docker-related details.
Karton images can also be easily configured to share files or directory with your host system.

karton's People

Contributors

barisione avatar subpop avatar wjt 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.