Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this tutorial we will write and run example ACS modules in Python, Java and C++ inside a Docker container based in a CentOS 7 image, in an Ubuntu 20.04 machine.

...

Install dependencies

Code Block
languagebash
sudo apt update

# Git LFS
sudo apt install git-lfs
git clone https://bitbucket.alma.cl/scm/asw/acs.git

Configurations

Install SELinux

...

languagebash

# SELinux
sudo apt install policycoreutils selinux-utils selinux-basics
sudo selinux-activate
sudo selinux-config-enforcing

# Docker
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
sudo apt install docker-ce

# Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version


Clone repository

https://bitbucket.alma.cl/scm/asw/acs.git

Code Block
languagebash
git clone https://bitbucket.alma.cl/scm/asw/acs.git


Configurations

Edit docker .env file (you can use your favourite editor)

Code Block
languagebash
cd Virtualization/Docker/Dev/
sudo nano .env
Code Block
languagetext
title.env
USER_NAME=<my_user>
GROUP_NAME=<my_group>
USER_ID=1000
GROUP_ID=1000
ALMA_DIR=/external/docker/alma
HOME_DIR=/external/docker/home
REPO_DIR=/absolute/path/to/cloned/repo
IMAGE_OS=centos7
CONTAINER_DIR=centos7


Run container

  1. To run a Docker container with ACS:

    Code Block
    languagebash
    docker-compose run --name acs_centos7_env centos7 bash
  2. To open a shell inside the container

    Code Block
    languagebash
    docker exec -it acs_centos7_env bash

...