Build Output and Dockerfile COPY #26034
-
My build outputs a dist directory via webpack. Problem: I’ve tried some COPY commands from the dist directory of my build but for some reason I’m not doing it right and the copy to my Docker container fails. I get:
Example Dockerfile where I cannot get copy to work:
also tried:
and
and
I know that the files are there because I ran an I already read Dockerfile support for GitHub Actions but I must be missing something obvious, just need another set of eyes Build.yml
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Hi. 👋 My knowledge of Docker is limited, but looking at the documentation for COPY, it copies files from the
Which from my understanding would copy the contents of the Hope that helps. 👍 |
Beta Was this translation helpful? Give feedback.
-
Thanks tried it but no luck. I wonder if it’s because I’m calling Yea the docs on build-push-action are lacking as to what the context is that the copy is done from. |
Beta Was this translation helpful? Give feedback.
-
I think the issue is that you’re using two jobs, so the build from one job isn’t shared to the next job, what you wanna use actions/upload-artifact and actions/download-artifact to share the build between jobs, there was also some changes to the download experience you would wanna read as well. |
Beta Was this translation helpful? Give feedback.
-
Thanks I’ll check that out. I assume I’d use download instead of |
Beta Was this translation helpful? Give feedback.
-
Got it working. First part was getting the artifact transfered, so thanks much! Second part was getting the Dockerfile right: Dockerfile - I added WORKDIR and then used current directory off the working directory:
Thanks for the tip on the artifacts! |
Beta Was this translation helpful? Give feedback.
-
Congratulations. 🎉 I’m glad I could provide some help that led to your solution, I wish you luck in further endeavors. 🙂 |
Beta Was this translation helpful? Give feedback.
I think the issue is that you’re using two jobs, so the build from one job isn’t shared to the next job, what you wanna use actions/upload-artifact and actions/download-artifact to share the build between jobs, there was also some changes to the download experience you would wanna read as well.