Skip to content

Commit 0928f1d

Browse files
committed
docs: add in error for non-existing path when copying
1 parent 409e681 commit 0928f1d

File tree

1 file changed

+26
-0
lines changed
  • sources/platform/actors/development/actor_definition

1 file changed

+26
-0
lines changed

sources/platform/actors/development/actor_definition/docker.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,32 @@ ENV UV_PROJECT_ENVIRONMENT="/usr/local"
151151

152152
With the move to a non-root user, this variable will cause `uv` to throw a permission error. You can safely remove this line, or, if you need it set to a custom path, adjust it to point to a location in the `/home/myuser` directory.
153153

154+
#### `stat /usr/src/app/dist: file does not exist`
155+
156+
With the change of the working directory to `/home/myuser`, you might see the following error:
157+
158+
```
159+
Docker image build failed: COPY failed: stat /usr/src/app/dist: file does not exist
160+
```
161+
162+
The fix is super simple! Find all your `COPY` instructions that copy files from the `/usr/src/app` directory and change them to copy from the `/home/myuser` directory instead.
163+
164+
:::tip Example
165+
166+
Previous:
167+
168+
```dockerfile
169+
COPY --from=builder /usr/src/app/dist ./dist
170+
```
171+
172+
New:
173+
174+
```dockerfile
175+
COPY --from=builder /home/myuser/dist ./dist
176+
```
177+
178+
:::
179+
154180
#### Copying files with the correct permissions
155181

156182
When using the `COPY` instruction to copy your files to the container, you should append the `--chown=myuser:myuser` flag to the command to ensure the `myuser` user owns the files.

0 commit comments

Comments
 (0)