GoogleContainerTools / GoogleContainerTools/skaffold

listing files: file pattern [./src/service2] must match at least one file

Open
#7,457 0 comments 4 reactions 0 assignees View on GitHub
area/build feature/multi-configs kind/bug priority/p2
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

### Expected behavior
When using single Dockerfile to build multiple services Skaffold shouldn't consider files that are not required for specified service.

### Actual behavior
Skaffold gives following error:

``` bash
skaffold dev
Listing files to watch...
- service1
listing files: file pattern [./src/service2] must match at least one file
```

### Information

- Skaffold version: v1.38.0
- Operating system: MacOs Monterey 12.3.1
- Installed via: Homebrew
- Contents of skaffold.yaml:

```yaml
apiVersion: skaffold/v2beta28
kind: Config
metadata:
name: app
build:

artifacts:
# image tags are relative; to specify an image repo (e.g. GCR), you
# must provide a "default repo" using one of the methods described
# here:
# https://skaffold.dev/docs/concepts/#image-repository-handling
- image: service1
context: .
docker:
buildArgs:
SERVICE: "service1"

local:
push: false
useBuildkit: true
# useDockerCLI: false

```

Dockerfile:
``` yaml
ARG SERVICE

FROM python:3.9.13-alpine3.16 as base

FROM base AS app-prod-service1
COPY ./src/service1 /app/src/

FROM base AS app-prod-service2
COPY ./src/service2 /app/src/

FROM app-prod-${SERVICE} as app
```

### Steps to reproduce the behavior

1. `skaffold dev`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.