diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7df02b62681af3ce102d0a51cba9d35f6a130037..c1c9c107b5f5503022b743e926100b71a5d00f45 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -29,6 +29,6 @@ build:
         --cache=false
         --context $CI_PROJECT_DIR
         --dockerfile $CI_PROJECT_DIR/Dockerfile
-        --destination $REGISTRY_IMAGE:2.5.7-buster
+        --destination $REGISTRY_IMAGE:2.4.59-buster
         --destination $REGISTRY_IMAGE:$CI_COMMIT_SHA
 ## End of Job
diff --git a/Dockerfile b/Dockerfile
index bd757bd0be8c630f2adeef62d978588b9b6376f5..017eafe6aec49d45401d01638b9a3d7ac14840d3 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -9,6 +9,7 @@ FROM debian:buster-slim
 LABEL maintainer="sfeng@stanford.edu"
 
 ENV DEBIAN_FRONTEND noninteractive
+
 RUN apt-get update && \
 	apt-get install -y -qq \
 	ca-certificates \
@@ -20,9 +21,27 @@ RUN apt-get update && \
 	openssl \
 	lmdb-utils \
 	krb5-user \
+	gnugpg \
 	kstart \
 	procps
 
+# local apt repos
+RUN apt-get -qq update \
+    && count=0 \
+    && until apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FDF37CD4279D4962 || [ $count -eq 5 ]; \
+    do \
+        count=`expr $count + 1`; sleep $count; \
+    done
+
+# Add souces file to find stanford-server-directory package
+ADD etc/apt/sources.list.d/stanford.list /etc/apt/sources.list.d/stanford.list
+ADD etc/apt/sources.list.d/local.list /etc/apt/sources.list.d/local.list
+RUN apt-get update --allow-unauthenticated \
+    && apt-get --assume-yes --allow-unauthenticated install --no-install-recommends \
+        stanford-keyring \
+        libreadonly-perl \
+        stanford-server-directory
+
 # Copy software from stage image
 COPY --from=builder /artifacts /
 
diff --git a/build.sh b/build.sh
index af5b7bcb02e17ad7d9d5bd0d988d094ad075032d..aad146416bdb84a403cdb71880b93c1d51205317 100755
--- a/build.sh
+++ b/build.sh
@@ -1,7 +1,7 @@
 #!/bin/bash -e
 # Maintainer: sfeng@stanford.edu
 
-OPENLDAP_VERSION=openldap-2.5.7
+OPENLDAP_VERSION=openldap-2.4.59
 CYRUS_SASL_VERSION=cyrus-sasl-2.1.27
 OPENLDAP_TARBALL=ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${OPENLDAP_VERSION}.tgz
 CYRUS_SASL_TARBALL=https://github.com/cyrusimap/cyrus-sasl/releases/download/${CYRUS_SASL_VERSION}/${CYRUS_SASL_VERSION}.tar.gz
diff --git a/env.sh b/env.sh
index dae9c2e0ae4a34b4a3b28578e4ad390fc0c04347..5c093f0343a1f1bb29f23fede388e9cad38ab5b5 100755
--- a/env.sh
+++ b/env.sh
@@ -8,8 +8,7 @@ export DRONE_SERVER=https://drone.svc.stanford.edu
 export DRONE_REPO=authnz/docker-${DOCKER_IMAGE}
 export DRONE_SEC_FILE=.drone.sec
 export DRONE_REGISTRY_FILE=.drone.reg
-#export DOCKER_IMAGE_VERSION=2.4.58-buster
-export DOCKER_IMAGE_VERSION=2.5.7
+export DOCKER_IMAGE_VERSION=2.4.59-buster
 
 # GitLab configuration
 export GITLAB_SERVER=https://code.stanford.edu