Introduction
Run the SAS Deployment Wizard to install SAS Studio on a supported Linux 64-bit operating system. During the installation change the default location for the SAS Studio installation to /opt/SASHome
.
mkdir $HOME/SASDocker
cd $HOME/SASDocker
Create a .TAR file that includes the SASHome directory. The TAR file is required in order to
build the Docker image.
tar — cvf SASHomeTar.tar /opt/SASHome
Create a .tar
file that includes the SASStudio path.
tar -cvf sasstudio.tar /opt/sas
Create the shell script called sasstudio.sh
to start SAS Studio when the container runs.
#! /bin/bash
/opt/SASHome/SASFoundation/9.4/utilities/bin/setuid.sh
/opt/SASHome/sas/studioconfig/sasstudio.sh start
tail -f /dev/null
Dockerfile
Create the Dockerfile.
FROM centos:latest
MAINTAINER Randy Betancourt <tr.btancourt@concast.net>
# Install libraries and clean all
RUN yum -y install numactl-libs.x86_64 \
passwd \
libXp \
libpng12 \
libXmu.x86_64 \
wget \
&& yum clean all
#Nginx libraries
RUN wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \
yum -y install net-tools \
epel-release-latest-7.noarch.rpm \
epel-release \
nginxyum \
nginx && \
rm -f epel-release-latest-7.noarch.rpm && \
yum clean all && \
mkdir -p /etc/nginx/conf.d/
COPY default.conf /etc/nginx/conf.d/
# Add group
RUN useradd -m sas
RUN groupadd -g 1001 sasstaff
# Add sas user
RUN usermod -a -G sasstaff sas
# Set default password by pointing to /etc/passwd
RUN echo -e "mypassword" | /usr/bin/passwd --stdin sas
# Make the SASHome directory and add the TAR file
RUN mkdir -p /opt/SASHome && \
mkdir -p /opt/sas
ADD SASHomeTar.tar / \
sasstudio.tar / \
/etc/pam.d/sasauth /etc/pam.d /
RUN chown -R sas:sasstaff /opt/SASHome && \
chown -R sas:sasstaff /opt/sas
EXPOSE 38080
# Add startup script to start SAS Studio
ADD startup.sh /
RUN chmod +x startup.sh
ENTRYPOINT ["/startup.sh"]
The first time the docker build command ran with this Dockerfile the container's partition became full, so reconfigure Docker to work with larger disk partitions.
Remove previously pulled images.
sudo rm -rf /var/lib/docker
Create the Docker Unit file directory.
sudo mkdir /etc/systemd/system/docker.service.d
Pass-in new arguments to the Docker start-up script by including the file docker.conf
in the directory above. Notice the %%
at the end of the command option.
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --storage-opt dm.basesize=50GB --storage-opt dm.min_free_space=50%%
Stop the Docker service.
sudo systemctl stop docker
Returns.
Warning: docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Reload Docker configuration file.
sudo systemctl daemon-reload
Start Docker.
sudo systemctl start docker
Another error encountered was:
Step 1/13 : FROM centos:latest
Get https://registry-1.docker.io/v2/: net/http: TLS handshake timeout
To get around this error, pull the centos:latest image before running the Docker build.
docker pull centos:latest
Returns.
latest: Pulling from library/centos
8ba884070f61: Pull complete
Digest: sha256:b5e66c4651870a1ad435cd75922fe2cb943c9e973a9673822d1414824a1d0475
Status: Downloaded newer image for centos:latest
Build
Build the image.
docker build -t sas4az:v1 .
Run
Run the container.
docker run -d -p 38080:38080 sas4az:v1
Return the container's log file.
docker logs 0d960e9e28fa
Performing the User Authentication setup step required by SAS.
Attempting to setuid bit and change ownership of files:sasperm sasauth elssrv , to root
User Authentication setup has successfully completed.
======================
= SAS Object Spawner =
======================
Spawner is started (pid 34)...
==============================
= SAS Web Application Server =
==============================
Tomcat started.
Status: RUNNING as PID=71
Launch a browser and point it to port 38080. SAS Studio will issue a re-redirct prompting for a user-id and password.