Skip to content

Commit

Permalink
Document how to change the dev container image pull policy (#7014)
Browse files Browse the repository at this point in the history
  • Loading branch information
rm3l authored Aug 2, 2023
1 parent 4361b9f commit 2a95404
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions docs/website/docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,37 @@ $ odo preference set ImageRegistry quay.io/$USER

</details>



[//]: # (## Devfile issues)

## Dev Sessions issues

### The Image Pull Policy of the dev container is `Always` and I cannot change it

#### Description
When starting `odo dev`, the [image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) of the dev container is currently hardcoded to `Always`,
which may not be ideal for all platforms.

#### Recommended Solution
The image pull policy can be changed by declaring a [`container-overrides`](https://devfile.io/docs/2.2.0/overriding-pod-and-container-attributes#container-overrides) attribute in the `container` component in the Devfile, like so:

```yaml
components:
- name: runtime
# highlight-start
attributes:
container-overrides:
imagePullPolicy: IfNotPresent
# highlight-end
container:
command: ['tail']
args: ['-f', '/dev/null']
endpoints:
- name: http-node
targetPort: 3000
image: registry.access.redhat.com/ubi8/nodejs-16:latest
mountSources: true
```

### I'm getting "Permission denied" errors when `odo dev` is syncing files

#### Description
Expand Down

0 comments on commit 2a95404

Please sign in to comment.