-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (29 loc) · 1.21 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
ARG BUILD_ARCH=x86_64
FROM sapk/archlinux:$BUILD_ARCH AS builder_env
LABEL maintainer="Jguer,joaogg3 at google mail"
ENV GO111MODULE=on
WORKDIR /app
RUN pacman -Syu --overwrite=* --needed --noconfirm \
gcc gnupg libldap go git tar make awk linux-api-headers pacman pacman-contrib && paccache -rfk0
# Dependency for linting
RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /bin v1.20.0
RUN go get golang.org/x/lint/golint && mv /root/go/bin/golint /bin/
ENV ARCH=$BUILD_ARCH
COPY . .
FROM builder_env AS builder
# Change to include packages individually. Helps caching
RUN make build
FROM archlinux/base:latest
RUN pacman -Syu --overwrite=* --needed --noconfirm \
git base-devel awk pacman-contrib && paccache -rfk0
# Gracefully removed from https://github.com/Cognexa/dockerfiles/blob/master/dockerfiles/archlinux
RUN useradd -m -s /bin/bash aur && \
passwd -d aur && \
echo 'aur ALL=(ALL) NOPASSWD: ALL' >/etc/sudoers.d/aur && \
echo 'Defaults env_keep += "EDITOR"' >>/etc/sudoers.d/aur
ENV EDITOR vim
# set UTF-8 locale
RUN echo 'en_US.UTF-8 UTF-8' >/etc/locale.gen && locale-gen
ENV LANG en_US.UTF-8
WORKDIR /work/
COPY --from=builder /app/yay .