Git Product home page Git Product logo

docker-env's Introduction

Docker-env

Usage

Preparations

  1. Install Docker Desktop (version 3.0+). For Windows, we recommend setting up WSL2.
  2. Copy docker-compose.yml to your course projects folder.

First-time Setup

For AMD64 Architecture

If your CPU is in AMD64 Architecture, in other words, if your CPU is not Apple M1, then do the following.

  1. Run docker pull cis548/docker-env to will pull the docker image from Docker Hub repository.
  2. Run docker-compose run --rm mcit to launch a Docker Container.
  • --rm will clean up the container when it is finished.
  • The home directory /home/cit595, also known as ~, is synchornized with the folder, where you put the docker-compose.yml, in your Host System.

You should now be inside your docker image, with current folder at /homw/cit595. You can use pwd to check.

You will log into the container as user cit595 with password mcit. The password is used just in case you occationally need sudo previlege.

For ARM64 Architecture

If you are using a machine with Apple M1 CPU, you need to do a few extra steps to compile the docker image locally.

  1. Copy Dockerfile to your course projects folder along with docker-compose.yml
  2. Run docker-compose build mcit to compile the docker image locally.
  3. Follow For AMD64 Architecture section, starting from the second step. In other words, run docker-compose run --rm mcit to launch a Docker Container.

All Future Log-ins

Just open your course projects folder, and run docker-compose run mcit bash.

Multiple Sessions

To establish multiple sesssion to the same container, call docker exec -it [container_id] bash after booting the first window with docker-compose run mcit.

About docker-compose

The following is the offical definition of docker-compose:

Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration.

In CIT 595, we only use docker-compose to start one service which is your virtual machine. But docker-compose make the command consice and convient because we can predefine the configuration in docker-compose.yml.

If we use the bare-mental docker to start the container with same configuration, you have to run

docker run -it --rm -v `pwd`:/home/cit595 cis548/docker-env

If we use docker-compose, it runs container with -it by default. The volume mounting is configed in docker-compose.yml. So we only need to call docker-compose run --rm cis548/docker-env.

This is why we choose to use docker-compose, but the overhead is you have to prepare a docker-compose.yml file.

Set up Vim

Vim is installed in the Docker container. We prepared a Vim configure file for students who would like to explore. The configuration file helps to install plug-ins and theme to make Vim more user-friendly and powerful. To use the configuration file, first use docker-compose run --rm cis548/docker-env to get into the container. Then do the following two steps.

# Step 1: Download the configuration file from CIS548
wget -O .vimrc https://raw.githubusercontent.com/CIS548/gists/master/example_vimrc.txt

# Step2: Update Vim based on the configuration files
vim -es -u vimrc -i NONE -c "PlugInstall" -c "qa"

Now you are ready for Vim!

(For TAs) Push Image to DockerHub

Docker Image in DockerHub (Link)

  • docker build -t cis548/docker-env .
  • docker push cis548/docker-env

Resources

docker-env's People

Contributors

benbarba avatar joshmhanson avatar kuang-da avatar xinhuili-penn avatar zhileiz avatar

Watchers

 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.