zotregistry.io/zot@v1.4.4-0.20231124084042-02a8ed785457/build/stacker-zxp.yaml (about)

     1  build:
     2    from:
     3      type: docker
     4      url: docker://ghcr.io/project-zot/golang:1.20
     5    binds:
     6      - ../. -> /zotcopy
     7    run: |
     8      export GO111MODULE=on 
     9      export GOPATH='/go'
    10      export HOME='/root'
    11      export PATH='/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
    12      mkdir -p /go/src/github.com/project-zot
    13      cd /go/src/github.com/project-zot
    14      git clone /zotcopy zot
    15      cd /go/src/github.com/project-zot/zot
    16      make COMMIT=${{COMMIT}} OS=${{OS}} ARCH=${{ARCH}} clean exporter-minimal
    17  
    18      cat > config.json << EOF
    19      {
    20        "Server":{
    21            "protocol":"http",
    22            "host": "127.0.0.1",
    23            "port": "5000"
    24        },
    25        "Exporter":{
    26            "port":"5001",
    27            "log":{
    28              "level":"debug"
    29            }
    30        }
    31      }
    32      EOF
    33  
    34      cat config.json
    35  
    36      mkdir -p /zotcopy/.build/${{REPO_NAME}}/binary
    37      mkdir -p /zotcopy/.build/${{REPO_NAME}}/config
    38      cp /go/src/github.com/project-zot/zot/bin/zxp-${{OS}}-${{ARCH}} /zotcopy/.build/${{REPO_NAME}}/binary
    39      cp /go/src/github.com/project-zot/zot/config.json /zotcopy/.build/${{REPO_NAME}}/config
    40    build_only: true
    41  
    42  "${{REPO_NAME:zxp}}":
    43    os: ${{OS}}
    44    arch: ${{ARCH}}
    45    from:
    46      type: docker
    47      url: docker://gcr.io/distroless/base-debian12:latest-${{ARCH}}
    48    overlay_dirs:
    49      - source: ../.build/${{REPO_NAME}}/binary
    50        dest: /usr/local/bin
    51      - source: ../.build/${{REPO_NAME}}/config
    52        dest: /etc/zxp
    53    entrypoint:
    54      - /usr/local/bin/zxp-${{OS}}-${{ARCH}}
    55    cmd:
    56      - config
    57      - /etc/zxp/config.json