├── .gitignore ├── README.md ├── authorize-and-start.sh ├── docker-compose.yml ├── dockerfile └── license └── prvc /.gitignore: -------------------------------------------------------------------------------- 1 | *.prvc 2 | *.tar.gz 3 | arcgisserver/ 4 | config-store/ 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ArcGIS For Server On Docker 2 | 3 | The following steps will bootstrap a CentOS [ArcGIS for Server](http://www.esri.com/software/arcgis/arcgisserver) in a [docker](https://www.docker.com/) container. 4 | 5 | ## ArcGIS Resources 6 | 7 | 1. Download ArcGIS for Server from [my.esri.com](https://my.esri.com/#/downloads) and rename it to `ags.tar.gz` and place it along side the dockerfile. 8 | 2. Download your license file from the [provisioning](https://my.esri.com/#/provisioning/417547) section and place it in the `/license/` folder. 9 | 10 | ## Build the Image 11 | 12 | This step is only necessary once. 13 | 14 | ```bash 15 | docker-compose build 16 | ``` 17 | 18 | ## Create and start a Container from the Image 19 | 20 | ```bash 21 | docker-compose up -d 22 | ``` 23 | 24 | ## Stop the container 25 | 26 | ```bash 27 | docker-compose down 28 | ``` 29 | 30 | ## Create a New Site 31 | 32 | Navigate to : 33 | 34 | ## Roadmap 35 | 36 | 1. Persist config store and data so container state is saved. 37 | 1. Bootstrap a container with services similar to how the license file thing works. 38 | 39 | 40 | Hat tip to [Mansour](https://twitter.com/mraad) for a great [reference](https://github.com/mraad/docker-arcgis) for how to get going with all of this. 41 | -------------------------------------------------------------------------------- /authorize-and-start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rwd=`dirname $0`/../../.. 4 | if [ -L "$0" ]; then 5 | link=`readlink $0` 6 | rwd=`dirname $link`/../../.. 7 | fi 8 | 9 | find /license -name "*.prvc" -print0 | while read -d $'\0' file 10 | do 11 | echo "authorizing arcgis server with ($file)" 12 | /arcgis/server/tools/authorizeSoftware -f $file -e agrc@utah.gov 13 | break 14 | done 15 | 16 | /arcgis/server/framework/etc/scripts/agsserver.sh start 17 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | 3 | services: 4 | arcgis-server: 5 | container_name: "arcgis-server" 6 | image: "arcgis-server:10.4.1" 7 | volumes: 8 | - "./license:/license" 9 | - "./arcgisserver:/arcgis/server/usr/directories" 10 | - "./config-store:/arcgis/server/usr/config-store" 11 | build: 12 | context: . 13 | dockerfile: "Dockerfile" 14 | ulimits: 15 | nproc: 25059 16 | nofile: 17 | soft: 65535 18 | hard: 65535 19 | ports: 20 | - "127.0.0.1:6080:6080" 21 | - "127.0.0.1:6443:6443" 22 | - "4001:4001" 23 | - "4002:4002" 24 | - "4004:4004" 25 | stdin_open: true 26 | tty: true 27 | -------------------------------------------------------------------------------- /dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:latest 2 | 3 | MAINTAINER @steveAGRC 4 | 5 | # set up environment variables 6 | ENV USER arcgis 7 | ENV GROUP arcgis 8 | 9 | # install server packages 10 | RUN yum -y --nogpg install xorg-x11-server-Xvfb.x86_64 \ 11 | fontconfig \ 12 | freetype \ 13 | gettext \ 14 | less \ 15 | htop \ 16 | vim \ 17 | mesa-libGLU \ 18 | libXtst \ 19 | libXi \ 20 | libXrender \ 21 | net-tools 22 | 23 | # copy files to arcgis location 24 | RUN mkdir /arcgis 25 | ADD ags.tar.gz /arcgis/ 26 | COPY authorize-and-start.sh /arcgis/ 27 | 28 | # set up permissions 29 | RUN groupadd $GROUP 30 | RUN useradd -m -r $USER -g $GROUP 31 | 32 | RUN chown -R $USER:$GROUP /arcgis 33 | RUN chmod -R 755 /arcgis 34 | 35 | USER $USER 36 | 37 | # install arcgis 38 | RUN /arcgis/ArcGISServer/Setup -m silent -l yes -d / 39 | 40 | # clean up install 41 | RUN rm -rf /ArcGISServer 42 | 43 | # set volumes up for provising file and directories 44 | VOLUME /license 45 | VOLUME /arcgis/server/usr/directories 46 | VOLUME /arcgis/server/usr/config-store 47 | 48 | # open ports 49 | EXPOSE 6080 6443 4001 4002 4004 50 | 51 | # start the server 52 | ENTRYPOINT /arcgis/authorize-and-start.sh && /bin/bash 53 | -------------------------------------------------------------------------------- /license/prvc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/steveoh/arcgis-on-docker/896cae7995b3a0d0916bdc39f86742b882257806/license/prvc --------------------------------------------------------------------------------