steep-nest-3156
10/21/2024, 1:43 PMaverage-finland-92144
10/21/2024, 1:45 PM.with_commands
you should be able tosteep-nest-3156
10/21/2024, 1:47 PMimage_spec = ImageSpec().with_commands(
'COPY ./packages /packages'
)
Got the error
=> ERROR [stage-2 8/10] RUN COPY ./packages /packages 0.2s
------
> [stage-2 8/10] RUN COPY ./packages /packages:
0.142 /bin/sh: 1: COPY: not found
------
Dockerfile:29
--------------------
27 |
28 |
29 | >>> RUN COPY ./packages /packages
30 |
31 |
--------------------
ERROR: failed to solve: process "/bin/sh -c COPY ./packages /packages" did not complete successfully: exit code: 127
Looks like it is still RUN
commandsteep-nest-3156
10/21/2024, 2:06 PMimage_spec = ImageSpec()
image_spec.copy = [
'./packages'
]
average-finland-92144
10/21/2024, 2:06 PMsteep-nest-3156
10/21/2024, 2:07 PMsteep-nest-3156
10/21/2024, 2:08 PMhigh-park-82026
with
should return a new ImageSpec with just the additional change (and points to the original as its base)
At image build time, we just run through the linked list in order.
@glamorous-carpet-83516 @high-accountant-32689steep-nest-3156
10/21/2024, 2:19 PMglamorous-carpet-83516
10/21/2024, 4:56 PMimage_spec = ImageSpec(base_image=ImageSpec(copy={...})).with_commands(...)
flytekit will build the first image that copy packages to the image, and then use it as base image for the second imageSpecsteep-nest-3156
10/22/2024, 1:03 PM