zotregistry.io/zot@v1.4.4-0.20231124084042-02a8ed785457/build/stacker-minimal.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}} RELEASE_TAG=${{RELEASE_TAG}} clean binary${{EXT:}}
    17      cat > config.json << EOF
    18      {
    19        "storage":{
    20            "rootDirectory":"/var/lib/registry"
    21        },
    22        "http":{
    23            "address":"0.0.0.0",
    24            "port":"5000"
    25        },
    26        "log":{
    27            "level":"debug"
    28        }
    29      }
    30      EOF
    31  
    32      cat config.json
    33      mkdir -p /zotcopy/.build/${{REPO_NAME}}
    34      cd /zotcopy/.build/${{REPO_NAME}}
    35  
    36      mkdir -p binary/ cert/ config/
    37  
    38      cp /go/src/github.com/project-zot/zot/bin/zot-${{OS}}-${{ARCH}}${{EXT:}} binary/
    39      cp /go/src/github.com/project-zot/zot/config.json config/
    40      cp /etc/ssl/certs/ca-certificates.crt cert/
    41    build_only: true
    42  
    43  "${{REPO_NAME:zot}}":
    44    os: ${{OS}}
    45    arch: ${{ARCH}}
    46    from:
    47      type: docker
    48      url: docker://gcr.io/distroless/base-debian12:latest-${{ARCH}}
    49    overlay_dirs:
    50      - source: ../.build/${{REPO_NAME}}/binary
    51        dest: /usr/local/bin
    52      - source: ../.build/${{REPO_NAME}}/cert
    53        dest: /etc/ssl/certs
    54      - source: ../.build/${{REPO_NAME}}/config
    55        dest: /etc/zot
    56    entrypoint:
    57      - /usr/local/bin/zot-${{OS}}-${{ARCH}}${{EXT:}}
    58    volumes:
    59      - /var/lib/registry
    60    cmd:
    61      - serve
    62      - /etc/zot/config.json