forked from crystal-linux/amethyst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Containerfile
33 lines (31 loc) · 1.01 KB
/
Containerfile
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
ARG BASE_IMAGE=docker.io/archlinux:latest
FROM ${BASE_IMAGE} as build_base
RUN pacman -Syu --noconfirm
RUN pacman -S --noconfirm base-devel curl bash
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
FROM build_base as builder
WORKDIR /usr/src
RUN cargo new amethyst
WORKDIR /usr/src/amethyst
COPY Cargo.toml Cargo.lock ./
RUN mkdir target
RUN cargo fetch
COPY src ./src
RUN cargo build --frozen
RUN mkdir /tmp/ame
RUN cp target/debug/ame /tmp/ame/
FROM ${BASE_IMAGE} as runtime
RUN pacman -Syu --noconfirm
RUN pacman -S --noconfirm base-devel zsh wget vim git binutils fakeroot pacman-contrib sudo
RUN useradd -r -d /home/ame -p $(echo "ame" | openssl passwd -1 -stdin) ame -G wheel
RUN echo '%wheel ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN mkdir /home/ame
RUN chown ame:ame /home/ame
COPY --from=builder /tmp/ame/ame /usr/bin/
RUN rm -f $(pacdiff -o -f)
USER ame
RUN mkdir -p /home/ame/.local/share
RUN touch /home/ame/.zshrc
ENV AME_LOG=debug,hyper=info,mio=info,want=info
ENTRYPOINT ["zsh"]