summarylogtreecommitdiffstats
path: root/Dockerfile
blob: 45d1d184d23285cf938f0d551611fd8b7cea6cc4 (plain)
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
# docker build --add-host=host.docker.internal:host-gateway

FROM archlinux:latest AS build-stage

RUN echo $'\
Server = https://mirrors.aliyun.com/archlinux/$repo/os/$arch\n\
Server = https://mirrors.cloud.tencent.com/archlinux/$repo/os/$arch\n\
' > /etc/pacman.d/mirrorlist

RUN echo $'\
[archlinuxcn]\n\
Server = https://mirrors.aliyun.com/archlinuxcn/$arch\n\
Server = https://mirrors.cloud.tencent.com/archlinuxcn/$arch\n\
' >> /etc/pacman.conf

RUN pacman-key --init
RUN pacman -Syu archlinuxcn-keyring base-devel pacman-contrib namcap --needed --noconfirm
RUN pacman -S yay --needed --noconfirm

RUN echo 'nobody ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
RUN usermod -d /tmp nobody

USER nobody
COPY --chown=nobody:nobody PKGBUILD glamor.patch /code/
WORKDIR /code

ENV ALL_PROXY=socks5h://host.docker.internal:1080
RUN updpkgsums
RUN makepkg --printsrcinfo > .SRCINFO
RUN yay -S aur/xrdp --needed --noconfirm
RUN gpg --recv-keys 61ECEABBF2BB40E3A35DF30A9F72CDBC01BF10EB
RUN makepkg -si --needed --noconfirm

RUN pacman -Ql xorgxrdp-glamor
RUN namcap PKGBUILD
RUN [ -z "$(namcap PKGBUILD 2>&1)" ]

FROM scratch AS export-stage
COPY --from=build-stage /code/PKGBUILD /code/.SRCINFO /