Dockerfile

This Dockerfile example uses a CentOS Stream 8 base image and contains all of ACS's OS dependencies. Click on "Expand source" to see the code.

Place this Dockerfile in the ACS repository at .../Virtualization/Docker/Dev/stream8

Dockerfile
FROM quay.io/centos/centos:stream8

ARG USER_NAME
ARG GROUP_NAME
ARG USER_ID
ARG GROUP_ID

# General packages
RUN dnf -y install epel-release
RUN dnf -y install vim redhat-lsb-core sudo dbus-x11 rsync dnf-plugins-core glibc-locale-source glibc-langpack-en
RUN yum install dnf-plugins-core
RUN dnf config-manager --set-enabled powertools

# Install Git and Git LFS
# RUN dnf -y install epel-release
RUN dnf -y install https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm
RUN dnf -y install git
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | bash
RUN dnf -y install git-lfs

# Install Java 11
RUN dnf -y install java-11-openjdk-devel
# echo 1| alternatives --config java_sdk_openjdk

# Prepare for Java
RUN mkdir -p /usr/java
RUN ln -s /usr/lib/jvm/java-openjdk /usr/java/default

# Install ACS required packages
RUN dnf -y install ksh gcc gcc-c++ gcc-gfortran libX11-devel libffi-devel perl readline-devel bzip2 bzip2-devel openssl-devel openldap-devel libxml2-devel freetype-devel libxslt-devel sqlite-devel expat-devel tcl-devel tk-devel bison flex autoconf unzip dos2unix procmail cppunit-devel doxygen graphviz cmake libarchive boost-devel swig astyle xerces-c-devel lcov

# ARCHIVE
RUN dnf -y install libtool libdb-devel

# ICD
RUN dnf -y install cmake blas-devel cfitsio-devel wcslib-devel lapack-devel

# CONTROL
RUN dnf -y install binutils-devel libmemcached-devel

# CORR
# RUN dnf -y install pgplot-devel

# CORRCommon
RUN dnf -y install kernel kernel-devel

# TELCAL
RUN dnf -y install motif-devel texlive

# RTI DDS
# cd / && curl http://*****:*****@webdav.sco.alma.cl/restricted/propietary/RTI-RHEL6-x86_64.tar.bz2 | tar -xj

# Debugging Tools
RUN dnf -y install gdb net-tools valgrind
RUN yum -y install tree meld

# Other dependencies
RUN yum install procmail

#  User configuration
RUN groupadd -r -g ${GROUP_ID} ${GROUP_NAME}
RUN useradd -r -m -u ${USER_ID} -g ${GROUP_NAME} ${USER_NAME}
RUN groupadd sudo
RUN usermod -aG sudo ${USER_NAME}
RUN echo new2me |passwd ${USER_NAME} --stdin
RUN echo "%sudo	ALL=(ALL)	ALL" >> /etc/sudoers
RUN echo "%sudo	ALL=(ALL)	NOPASSWD: ALL" >> /etc/sudoers
USER ${USER_NAME}

Compose file

Click on "Expand source" to see the code.

Place this Dockerfile in the ACS repository at .../Virtualization/Docker/Dev

docker-compose.yml
version: "3.4"

x-args: &args
   USER_NAME: ${USER_NAME}
   GROUP_NAME: ${GROUP_NAME}
   USER_ID: ${USER_ID}
   GROUP_ID: ${GROUP_ID}

x-env: &env
   - DISPLAY=${DISPLAY}

x-volumes: &volumes
   - ${REPO_DIR}:/repo:z
   - ${ALMA_DIR}/${CONTAINER_DIR}:/alma:z
   - ${HOME_DIR}/${CONTAINER_DIR}:/home/${USER_NAME}:z
   - /tmp/.X11-unix:/tmp/.X11-unix:z

x-acs-images: &common
   build:
      dockerfile: Dockerfile
      context: ./${IMAGE_OS}
      args: *args
   security_opt:
      - seccomp:unconfined
   image: acsdev-${IMAGE_OS}
   environment: *env
   volumes: *volumes
   working_dir: /home/${USER_NAME}
   ulimits:
      nproc: 62424
      nofile:
         soft: 64000
         hard: 524288
   hostname: acs
   container_name: acs_${IMAGE_OS}
   network_mode: host

services:
   centos6:
      <<: *common
   centos7:
      <<: *common
   centos8:
      <<: *common
   stream8:
      <<: *common

Env file

Click on "Expand source" to see the code.

Place this Dockerfile in the ACS repository at .../Virtualization/Docker/Dev

.env
USER_NAME=<my_user>
GROUP_NAME=<my_user>
USER_ID=1000
GROUP_ID=1000
ALMA_DIR=/ACS/docker/alma
HOME_DIR=/ACS/docker/home
REPO_DIR=/absolute/path/to/ACS/repository
IMAGE_OS=stream8
CONTAINER_DIR=stream8

Run and open the container

# Create directories
sudo mkdir -p /ACS/docker/alma /ACS/docker/home

# Set ownership for directories
sudo chown -R $USER:$USER /ACS

# Run container
cd .../Virtualization/Docker/Dev
docker compose run -d --name acs_stream8 stream8

Set /etc/hosts file

# Add the following line to /etc/hosts to prevent networking issues
127.0.1.1	acs

Install external products

This step must be executed inside a new container terminal.

# Install external products
docker exec -it acs_stream8 bash
source /repo/LGPL/acsBUILD/config/.acs/.bash_profile.acs
cd /repo/ExtProd/INSTALL
make all

Build ACS

This step must be executed inside a new container terminal.

# Build ACS
docker exec -it acs_stream8 bash
source /repo/LGPL/acsBUILD/config/.acs/.bash_profile.acs
cd /repo
make build

# Run ACS
acsStart

Troubleshooting

If you have any issues installing ACS or its dependencies try the following:

While installing external products

Click on "Expand source" to see the code.

Check permissions for directories /ACS/docker, /ACS/docker/alma and /ACS/docker/home in your machine, the owner and group should be your user (not root).

There are logs for each component in /repo/ExtProd/INSTALL which you can check for diagnostics.

Console output with errors
> make all
WARNING: Do not close this terminal: some build might fail!
Target directory  already exist.
2021-11-29T18:18:55 buildTclTk [3m10.381s]                 [  OK  ]
2021-11-29T18:22:05 buildTAO [0m2.881s]                    [==> FAILED]
2021-11-29T18:22:08 buildMaven [0m0.005s]                  [==> FAILED]
2021-11-29T18:22:08 buildJavaDependencies [0m0.006s]       [==> FAILED]
2021-11-29T18:22:08 buildExternalDependencies [0m0.025s]   [==> FAILED]
2021-11-29T18:22:08 buildAnt [0m0.004s]                    [==> FAILED]
2021-11-29T18:22:08 buildJacorb ==== Building JacORB from: /Repos/ExtProd/INSTALL/../PRODUCTS into: /
jacorb: Env Variable JACORB_HOME no set. Review your deployment
[0m0.006s]                                                 [==> FAILED]
2021-11-29T18:22:08 buildPython [0m0.016s]                 [  OK  ]
2021-11-29T18:22:08 buildPyModules [0m0.007s]              [==> FAILED]
2021-11-29T18:22:08 buildOmniORB [0m22.676s]               [  OK  ]
2021-11-29T18:22:31 buildEclipse [9m54.753s]               [  OK  ]
2021-11-29T18:32:25 buildSwig [0m25.429s]                  [  OK  ]
2021-11-29T18:32:51 buildBoost [0m20.637s]                 [  OK  ]
WARNING: Now log out and login again to make sure that
         the environment is re-evaluated!
 
__oOo__
2021-11-29T18:33:11 buildTools script has finished
 . . . 'all' done

While building ACS

Click on "Expand source" to see the code.

You can try to build ACS in another terminal, or reset the local repo and build again.

sudo git clean -fdx -- .
make build
Console output with errors
> make build
Evaluating current ACS TAG from https://bitbucket.alma.cl/scm/asw/acs.git
REPO tag is: master
############ Clean Build Log File: build.log #################
############ Check directory tree for modules  #################
############ Prepare installation areas      #################
### ==> FAILED! 
  • No labels