REPOSITORY_KEY ?= OSM%20ETSI%20Release%20Key.gpg
REPOSITORY ?= testing
NO_CACHE ?= --no-cache
+DOCKER_REGISTRY ?= ""
LOWER_MDG = $(shell echo $(MDG) | tr '[:upper:]' '[:lower:]')
rm -f $(MKBUILD)/.dep*
tag:
- docker tag opensourcemano/$(CONTAINER_NAME):$(INPUT_TAG) opensourcemano/$(LOWER_MDG):$(TAG)
+ docker tag opensourcemano/$(CONTAINER_NAME):$(INPUT_TAG) $(DOCKER_REGISTRY)opensourcemano/$(LOWER_MDG):$(TAG)
push: tag
- docker push opensourcemano/$(LOWER_MDG):$(TAG)
+ docker push $(DOCKER_REGISTRY)opensourcemano/$(LOWER_MDG):$(TAG)
remove_stack osm_elk
fi
echo "Now osm docker images and volumes will be deleted"
- # TODO: clean-up of images should take into account if other tags were used for specific modules
+ # TODO: clean-up of images should take into account if other tags were used for specific modules
newgrp docker << EONG
for module in ro lcm keystone nbi mon pol pla osmclient; do
docker image rm ${DOCKER_REGISTRY_URL}${DOCKER_USER}/${module}:${OSM_DOCKER_TAG}
echo "Configuring docker proxy ..."
if [ -f /etc/docker/daemon.json ]; then
if grep -q registry-mirrors /etc/docker/daemon.json; then
- sudo sed -Ei 's/("registry-mirrors".*\[)(.*)\]/\1\2, \"'"${DOCKER_PROXY_URL}"'\"\]/' /etc/docker/daemon.json
+ sudo sed -i "s|registry-mirrors.*|registry-mirrors\": [\"${DOCKER_PROXY_URL}\"] |" /etc/docker/daemon.json
else
- sudo sed -i 's/{/{\n "registry-mirrors": [\"'"${DOCKER_PROXY_URL}"'\"]",/' /etc/docker/daemon.json
+ sudo sed -i "s|{|{\n \"registry-mirrors\": [\"${DOCKER_PROXY_URL}\"],|" /etc/docker/daemon.json
fi
else
- sudo bash -c 'cat << EOF > /etc/docker/daemon.json
+ sudo bash -c "cat << EOF > /etc/docker/daemon.json
{
- "registry-mirrors": ["${DOCKER_PROXY_URL}"]
+ \"registry-mirrors\": [\"${DOCKER_PROXY_URL}\"]
}
-EOF'
+EOF"
fi
sudo systemctl daemon-reload
sudo service docker restart
if [ $module == "PLA" -a ! -n "$INSTALL_PLA" ]; then
continue
fi
- module_tag="${OSM_DOCKER_TAG}"
+ module_tag="${OSM_DOCKER_TAG}"
if [ -n "${MODULE_DOCKER_TAG}" ] && echo $TO_REBUILD | grep -q $module ; then
module_tag="${MODULE_DOCKER_TAG}"
fi
- echo "Pulling ${DOCKER_REGISTRY_URL}${DOCKER_USER}/${module_lower}:${module_tag} docker image"
+ echo "Pulling ${DOCKER_REGISTRY_URL}${DOCKER_USER}/${module_lower}:${module_tag} docker image"
sg docker -c "docker pull ${DOCKER_REGISTRY_URL}${DOCKER_USER}/${module_lower}:${module_tag}" || FATAL "cannot pull $module docker image"
done
else