A dockerized development environment for MCIT-595
10K+
docker-compose.yml to your course projects folder.If your CPU is in AMD64 Architecture, in other words, if your CPU is not Apple M1, then do the following.
docker pull cis548/docker-env to will pull the docker image from Docker Hub repository.docker-compose run --rm mcit to launch a Docker Container.--rm will clean up the container when it is finished./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 /home/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.
If you are using a machine with Apple M1 CPU, you need to do a few extra steps to compile the docker image locally.
Dockerfile to your course projects folder along with docker-compose.ymldocker-compose build mcit to compile the docker image locally.docker-compose run --rm mcit to launch a Docker Container.Just open your course projects folder, and run docker-compose run --rm mcit.
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.
docker-composeThe 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 under mcit service. So we only need to call docker-compose run --rm mcit.
This is why we choose to use docker-compose, but the overhead is you have to prepare a docker-compose.yml file.
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 mcit 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!
Docker Image in DockerHub (Link)
We use docker buildx to generate images for AMD64 and ARM64 CPUs. The steps are as follows.
mybuilder.docker buildx create --name mybuilder
mybuilder as the new default builder and double-check the change is in effect.docker buildx use mybuilder
docker buildx inspect --bootstrap
cis548/docker-env. To push images to the Docker Hub reposiotry, make sure you have the right permissons to the repo.docker buildx build . --platform=linux/amd64,linux/arm64/v8 -t cis548/docker-env --push
Content type
Image
Digest
sha256:618c025e7…
Size
862.1 MB
Last updated
over 1 year ago
docker pull cis548/docker-env