-&& apk add --no-cache --virtual .build-deps build-base go godep git curl tar \
-&& curl -fsSL -k https://github.com/docker/distribution/archive/v${REGISTRY_VERSION}.tar.gz | tar zx --strip-components=1 \
+&& apk add --no-cache --virtual .build-deps build-base go godep git curl tar bash \
+&& mkdir -p $go_install_dir \
+&& curl -fsSL -k https://dl.google.com/go/go${go_version}.src.tar.gz | tar zx --strip-components=1 -C ${go_install_dir} \
+&& cd ${go_install_dir}/src/ \
+&& ./make.bash \
+&& mkdir -p ${GOPATH}/src/github.com/docker/distribution \
+&& curl -fsSL -k https://github.com/docker/distribution/archive/v${REGISTRY_VERSION}.tar.gz | tar zx --strip-components=1 -C ${GOPATH}/src/github.com/docker/distribution \
+&& cd ${GOPATH}/src/github.com/docker/distribution \