Dockerfile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ARG BUILD_ARCH=x86_64
  2. FROM sapk/archlinux:$BUILD_ARCH AS builder_env
  3. LABEL maintainer="Jguer,joaogg3 at google mail"
  4. ENV GO111MODULE=on
  5. WORKDIR /app
  6. RUN pacman -Syu --overwrite=* --needed --noconfirm \
  7. gcc gnupg libldap go git tar make awk linux-api-headers pacman-contrib && paccache -rfk0
  8. # Dependency for linting
  9. RUN go get golang.org/x/lint/golint && mv /root/go/bin/golint /bin/
  10. ENV ARCH=$BUILD_ARCH
  11. ADD . .
  12. FROM builder_env AS builder
  13. # Change to include packages individually. Helps caching
  14. RUN make build
  15. FROM archlinux/base:latest
  16. RUN pacman -Syu --overwrite=* --needed --noconfirm \
  17. git base-devel awk pacman-contrib && paccache -rfk0
  18. # Gracefully removed from https://github.com/Cognexa/dockerfiles/blob/master/dockerfiles/archlinux
  19. RUN useradd -m -s /bin/bash aur \
  20. && passwd -d aur \
  21. && echo 'aur ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/aur \
  22. && echo 'Defaults env_keep += "EDITOR"' >> /etc/sudoers.d/aur
  23. ENV EDITOR vim
  24. # set UTF-8 locale
  25. RUN echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen && locale-gen
  26. ENV LANG en_US.UTF-8
  27. WORKDIR /work/
  28. COPY --from=builder /app/yay .