3

I'm trying to run KrakenD image in Azure App Service.

KrakenD requires json config file krakend.json to be put into /etc/krakend/ (KrakenD image is based on Linux Alpine)

I created Web App for containers with the following docker-compose file:

version: "3"
services:
  krakend:
    image: devopsfaith/krakend:latest
    volumes:
      - ${WEBAPP_STORAGE_HOME}/site/krakend:/etc/krakend
    ports:
      - "8080:8080"
    restart: always

Added storage account with a blob container where uploaded sample kraken.json file enter image description here

In app configuration i added a path mapping like this:

enter image description here

But it looks like volume was not mounted correctly

2019-11-15 12:46:29.368 ERROR - Container create failed for krakend_krakend_0_3032a936 with System.AggregateException, One or more errors occurred. (Docker API responded with status code=InternalServerError, response={"message":"invalid volume specification: ':/etc/krakend'"} ) (Docker API responded with status code=InternalServerError, response={"message":"invalid volume specification: ':/etc/krakend'"} ) InnerException: Docker.DotNet.DockerApiException, Docker API responded with status code=InternalServerError, response={"message":"invalid volume specification: ':/etc/krakend'"}

2019-11-15 12:46:29.369 ERROR - multi-container unit was not started successfully

Additional questions

  1. What does mean Mount path in Storage mounting? - i put there value /krankend

  2. volume definition starts with ${WEBAPP_STORAGE_HOME} in docs they specified it as

    volumes: - ${WEBAPP_STORAGE_HOME}/site/wwwroot:/var/www/html

so i did it by analogy and tried all 3 possible paths

${WEBAPP_STORAGE_HOME}/site/wwwroot/krakend
${WEBAPP_STORAGE_HOME}/site/krakend
${WEBAPP_STORAGE_HOME}/krakend

but no luck - still getting the error

ERROR parsing the configuration file: '/etc/krakend/krakend.json' (open): no such file or directory

Artem Vertiy
  • 1,002
  • 15
  • 31

2 Answers2

9

finally resolved that with the following docker-compose file

version: "3"
services:
  krakend:
    image: devopsfaith/krakend:latest
    volumes:
      - volume1:/etc/krakend
    environment:
     WEBSITES_ENABLE_APP_SERVICE_STORAGE: TRUE
    ports:
      - "8080:8080"
    restart: always

where volume1 is a blob storage mounted as the following

enter image description here

Artem Vertiy
  • 1,002
  • 15
  • 31
0

This did not work for me. I was getting Bind mount must start with ${WEBAPP_STORAGE_HOME}.

This worked. docker-compose.yml

version: "3"
services:

  backend:
    image: xxxx
    ports:
      - 80:80
    volumes:
      - vol1:/var/www/html/public

volumes: 
   vol1:
      driver: local

Volume definition:

  • Name: vol1
  • Config: basic
  • Storage accounts: ...
  • Storage container: ...
  • Mount paht: /var/www/html/public
Jarda Pavlíček
  • 1,636
  • 17
  • 16