Git Product home page Git Product logo

docker-envs's Introduction

My Docker Environments

A simple Dockerfile for an Ubuntu 22.04 development environment. Portable for use with classes, projects, development, research, and more. It is also useful as an experimental sandbox and packaging your work for reproducible work for dissemination.

As of now these environments are only on Ubuntu but in theory should be able to be ported to other distros by changing the FROM at the beginning of the Dockerfile. Keep in mind you may need to change the package manager and other distro-specific commands in the Dockerfile.

Basic Usage:

While the basic use command will work, looking at the readme.md file in each respective directory will yield better results and more granular functionality.

docker run --name <container-name> -ti s7117/ubuntu-<suffix>:<tag>

Continued Usage:

WARNING: Do NOT use the docker start command to launch additional shells. See Launching a second shell for this information.

Starting a stopped container:

To continue to use a container that was created by using the docker run command above use the following once:

docker start -ai <container-name>

NOTE: If you did not name your container use docker container ls -a to determine the Docker randomly assigned name/id.

Launching a second shell:

Use the following command on a running Docker container to launch a new shell in the container (you can replace /bin/bash with another command if you would like to run another shell/command):

docker exec -ti <container-name> /bin/bash

Stopping a container:

Use the following command to stop/terminate a running container:

docker stop <container-name>

Detailed Usage:

See the README.md in each respective directory for specific usage instructions and details.

See docs/common-docker.md for some common docker commands and their definitions.

Environments

  • ubuntu-base - Customized Ubuntu Development Environment
  • ubuntu-cuda - Customized CUDA Image
  • ubuntu-cuda-ml - Machine Learning Image with PyTorch (torchgpu) and TensorFlow GPU (tfgpu) installed under Miniforge3
  • ubuntu-ml - Machine Learning Image with PyTorch (torchgpu) and TensorFlow CPU (tfgpu) installed under Miniforge3

Confirming Device Passthrough

Use lsusb and lspci to confirm that the devices desired to be accessible in the Docker container appear.

GPU Passthrough

Check that TensorFlow/PyTorch can see the GPU:

>>> # TensorFlow
>>> import tensorflow as tf
>>> tf.config.list_physical_devices('GPU')
>>> tf.sysconfig.get_build_info()['cuda_version']
>>> # PyTorch
>>> import torch
>>> torch.cuda.is_available()
>>> torch.version.cuda

Docker Aliases

If you want some easy and quick shortcuts for using Docker consider taking a look at my .dotfiles GitHub repository!

Some simple examples:

  • dils: list all Docker images
  • dcls: list all Docker containers
  • drmi: delete a Docker image
  • drmc: delete a Docker container
  • dclean: delete all Docker containers and images and prune caches.

docker-envs's People

Contributors

s7117 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

docker-envs's Issues

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.