Coder Social home page Coder Social logo

docker-useful's Introduction

Launch a dokcer container with support for GDB and mount a docker volume

docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --rm --name wcont -it -v workdir:/home -w /home linuxdevenv:18.04 /bin/bash

  • linuxdevenv:18.04 is the docker image, workdir is the dokcer volume
  • wcont is a name the running docker conatiner can be identified with
  • upon launch this will provide a shell, the -it option is required to launch a shell

Managing files between host and container

create a docker volume named workdir

docker volume create workdir

copy files to docker volume from host directory

  1. A docker conatiner is necessary to copy files into the docker-volume named workdir

  2. Start a dummy container to facilitate copying docker run -d --rm --name dummy -v workdir:/home ubuntu tail -f /dev/null

  3. Copy all files from host directory dirname into docker-volume workdir docker cp c:\dirname\* dummy:/home/*

  4. Stop the container docker stop dummy

copy files to host directory from docker-volume

  • docker cp dummy:/home/* c:\dirname\

Saving and exporting to transfer images

saving a docker image in tar format

docker save --output="output.tar" image_name

exporting a docker container in tar format

docker export --output="output.tar" container_id

docker-useful's People

Contributors

ahsan2github avatar

Watchers

James Cloos 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.