1. týždeň

Docker

Use Docker to Code

Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications.

If you have any problems with running applications locally (for example, installing some packages and dependencies, such as karel-the-robot), you can use our specially prepared docker image to simplify work and study.

Install Docker

It is necessary to have docker installed in order to proceed further. Therefore, please see the instructions for installing docker on this link.

Ubuntu Image

The main purpose of this image is to simplify the work with the karel-the-robot library, which is not supported on some Linux distributions or macOS

Image is specifically created for CS0-CS1 students at the Technical University of Kosice.

How to Use

The following commands will start the ubuntu bash terminal directly in the directory you are in. Therefore, it is possible to work with your local files and data.

Unix, Windows Powershel

Simply move to the working directory in the terminal and execute the command:

docker run --rm -ti -v ${PWD}:/app jakubhricik/ubuntu-zap:latest

Windows cmd

Move to the working directory in the terminal and execute the command:

docker run --rm -ti -v %cd%:/app jakubhricik/ubuntu-zap:latest

Use with docker-compose

It is also possible to use this image using the docker-compose tool.

This option will allow you to install additional functionalities in your ubuntu terminal, which will be saved and you will be able to use them during repeated startup.

To use this option, you have to make some working directory and create file nemed docker-compose.yml in there.

Insert this code into docker-compose.yml:

version: '3.1'
services:
  zap:
    image: jakubhricik/ubuntu-zap
    restart: unless-stopped
    command: sleep infinity
    volumes:
      - .:/app

Next, execute this command to init and generate new container:

docker-compose up -d

Upozornenie

Make sure docker is running!

Upozornenie

Also, you should execute this command only once.

To run ubuntu terminal, you have to be in directory where your docker-compose.yml file is located.

Run this command and ubuntu bash will replace your current terminal:

docker-compose exec zap bash

Additional Links