sample-hello-world-azure-functions icon indicating copy to clipboard operation
sample-hello-world-azure-functions copied to clipboard

Fail to build Image on Step 9a

Open pplavetzki opened this issue 5 years ago • 0 comments

Environment

Ubuntu 18.04 Docker:

Client: Docker Engine - Community
 Version:           19.03.7
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        7141c199a2
 Built:             Wed Mar  4 01:22:36 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.7
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       7141c199a2
  Built:            Wed Mar  4 01:21:08 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Azure Functions Core Tools: 3.0.2245 func kubernetes deploy --name hello-keda --registry xxxxxxxxxx --dry-run

data:
  FUNCTIONS_WORKER_RUNTIME: bm9kZQ==
  AzureWebJobsStorage: XXXXXXXXXXXXXXXXXX
apiVersion: v1
kind: Secret
metadata:
  name: hello-keda
  namespace: default
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-keda
  namespace: default
  labels:
    app: hello-keda
spec:
  selector:
    matchLabels:
      app: hello-keda
  template:
    metadata:
      labels:
        app: hello-keda
    spec:
      containers:
      - name: hello-keda
        image: paulplavetzki/hello-keda
        env:
        - name: AzureFunctionsJobHost__functions__0
          value: QueueTrigger
        envFrom:
        - secretRef:
            name: hello-keda
---
apiVersion: keda.k8s.io/v1alpha1
kind: ScaledObject
metadata:
  name: hello-keda
  namespace: default
  labels:
    deploymentName: hello-keda
spec:
  scaleTargetRef:
    deploymentName: hello-keda
  triggers:
  - type: azure-queue
    metadata:
      name: myQueueItem
      type: queueTrigger
      direction: in
      queueName: js-queue-items
      connection: AzureWebJobsStorage
---

Error

Running 'docker build -t paulplavetzki/hello-keda /home/pplavetzki/development/hack/hello-keda'.......................done
Error running docker build -t paulplavetzki/hello-keda /home/pplavetzki/development/hack/hello-keda.
output: Sending build context to Docker daemon  11.26kB

Step 1/4 : FROM mcr.microsoft.com/azure-functions/node:3.0
3.0: Pulling from azure-functions/node
8ec398bc0356: Pulling fs layer
fdb3dcd3402e: Pulling fs layer
3f9a385b80e9: Pulling fs layer
e890320b6235: Pulling fs layer
9e15ad3389a8: Pulling fs layer
75fa7c47d1cf: Pulling fs layer
e890320b6235: Waiting
9e15ad3389a8: Waiting
75fa7c47d1cf: Waiting
fdb3dcd3402e: Verifying Checksum
fdb3dcd3402e: Download complete
8ec398bc0356: Verifying Checksum
8ec398bc0356: Download complete
8ec398bc0356: Pull complete
fdb3dcd3402e: Pull complete
3f9a385b80e9: Verifying Checksum
3f9a385b80e9: Download complete
3f9a385b80e9: Pull complete
75fa7c47d1cf: Verifying Checksum
75fa7c47d1cf: Download complete
9e15ad3389a8: Verifying Checksum
9e15ad3389a8: Download complete
e890320b6235: Download complete
e890320b6235: Pull complete
9e15ad3389a8: Pull complete
75fa7c47d1cf: Pull complete
Digest: sha256:59402486e0d3d4a7042470798de37ed036ecda5e71d4a61be6a25d977c1b0278
Status: Downloaded newer image for mcr.microsoft.com/azure-functions/node:3.0
 ---> d69666cc3d2f
Step 2/4 : ENV AzureWebJobsScriptRoot=/home/site/wwwroot     AzureFunctionsJobHost__Logging__Console__IsEnabled=true
 ---> Running in c0f5d9851333
Removing intermediate container c0f5d9851333
 ---> fcd540a71615
Step 3/4 : COPY . /home/site/wwwroot
 ---> ac67f8896a46
Step 4/4 : RUN cd /home/site/wwwroot &&     npm install
 ---> Running in 777ee398c30c
/bin/sh: 1: npm: not found

Expected

I assumed it would build the image, push to registry and then deploy to k8s.

pplavetzki avatar Mar 07 '20 23:03 pplavetzki