netbootxyz / netboot.xyz

Your favorite operating systems in one place. A network-based bootable operating system installer based on iPXE.
https://netboot.xyz
Apache License 2.0
9.27k stars 684 forks source link

Dockerfile: FromAsCasing: 'as' and 'FROM' keywords' casing do not match #1532

Closed flyingfishflash closed 3 days ago

flyingfishflash commented 3 days ago

I'm performing a custom build netboot-xyz in a drone pipeline and am receiving the following warning:

 2 warnings found (use --debug to expand):
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 3)
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 14)
Dockerfile:15
--------------------
  14 |     FROM netbootxyz-${NBXYZ_OVERRIDES} as final
  15 | >>> RUN \
  16 | >>>   echo "**** running ansible ****" && \
  17 | >>>   cd /ansible && \
  18 | >>>   ansible-playbook -i inventory site.yml ${EXTRA_VARS}
  19 |  

Can this be resolved by fixing lines: https://github.com/netbootxyz/netboot.xyz/blob/cc085a7b602d235047f438b2f8e184b753f3e6e0/Dockerfile#L3 https://github.com/netbootxyz/netboot.xyz/blob/cc085a7b602d235047f438b2f8e184b753f3e6e0/Dockerfile#L14

so that both the FROM and AS keywords are uppercase?


For context, this is my drone step:

  - name: build
    image: docker:dind
    depends_on:
      - apply upstream version
    volumes:
    - name: dockersocket
      path: /var/run/docker.sock
    commands:
      - pwd
      # place custom user overrides
      - cp -v netbootxyz-configuration/user_overrides.yml working/netbootxyz/
      # place custom menu templates (see corresponding user_overrides)
      - mkdir working/netbootxyz/roles/netbootxyz/templates/custom
      - cp -v netbootxyz-configuration/custom-menu-templates/* working/netbootxyz/roles/netbootxyz/templates/custom
      # build
      - cd working/netbootxyz
      - docker build --no-cache -t netboot-build -f Dockerfile .
      - cid=$(docker create netboot-build)
      - docker cp $cid:/mnt/ $PWD/buildout
      # place file containing upstream netboot.xyz version
      - cp -v version.txt buildout/upstream-version.txt
      # clean-up
      - docker container prune -f
      - docker image rm netboot-build
      - cd /drone/src/

Thanks!

flyingfishflash commented 3 days ago

@antonym thanks, know it's a small item.