diff --git a/docker/swift/swift-base/Dockerfile.j2 b/docker/swift/swift-base/Dockerfile.j2
index 786e71535163a4be544137498366c1ef3a5d531e..0fbe2997391af240e5c9ee7857a87c9bcce84d14 100644
--- a/docker/swift/swift-base/Dockerfile.j2
+++ b/docker/swift/swift-base/Dockerfile.j2
@@ -9,6 +9,19 @@ RUN yum -y install openstack-swift \
 
     {% endif %}
 {% elif install_type == 'source' %}
+    {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
+
+RUN yum -y install \
+        liberasurecode-devel \
+    && yum clean all
+
+    {% elif base_distro in ['ubuntu'] %}
+
+RUN apt-get install -y --no-install-recommends \
+        liberasurecode-dev \
+    && apt-get clean
+
+    {% endif %}
 
 ADD swift-base-archive /swift-base-source
 RUN ln -s swift-base-source/* swift \