Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
412 views
in Technique[技术] by (71.8m points)

docker - Packer Github Actions: no such file or directory

I am trying to run packer file on a specific sub-directory (packer/beta):

  - name: packer
    run: |
      ls -la 
      && echo "starting docker" 
      && docker run hashicorp/packer build -debug packer.json
    working-directory: 'packer/beta'

I can see the file packer.json when I do ls -la.

I got the same error with this version:

  - name: packer
    uses: docker://hashicorp/packer:1.4.3
    with:
      args: build packer.json

I can use a relative path, for instance, packer/beta/packer.json instead of just packer.json, and it works, but that will affect the packer process because I have relative paths inside of it:

 "provisioners": [
    {
      "type": "file",
      "source": "root",
      "destination": "/tmp/root"
    },
  }

I would need to change the "source": "root" to "source": "packer/beta/root", and that's not what I want.

Also, I have tried:

defaults:
  run:
    working-directory: packer/beta

But still no luck.

Any idea on how can I achieve this?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share

1.2m questions

2.1m answers

5 comments

56.5k users

...