-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.dev
95 lines (95 loc) · 3.46 KB
/
Dockerfile.dev
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# syntax=docker/dockerfile:1
ARG BASE=bitnami/minideb
ARG TAG=bookworm
ARG IMAGE=$BASE:$TAG
FROM $IMAGE
#
# %labels
#
LABEL author="Jason Wohlgemuth"
LABEL org.opencontainers.image.source=https://github.com/jhwohlgemuth/gold
LABEL org.opencontainers.image.description="Development environment to build on"
LABEL org.opencontainers.image.licenses=MIT
#
# %arguments
#
ARG VERSION=0.0.1
ARG HOME=/root
ARG DEBIAN_FRONTEND=noninteractive
ARG LANG=en_US.UTF-8
ARG LANGUAGE=en_US:en
ARG LC_ALL=en_US.UTF-8
ARG S6_OVERLAY_VERSION=3.1.5.0
ARG S6_OVERLAY_GITHUB=https://github.com/just-containers/s6-overlay
#
# %environment
#
ENV VERSION="${VERSION}"
ENV TZ=America/New_York
ENV SHELL=/usr/bin/zsh
ENV TERM=xterm-256color
ENV DOTFILES="${HOME}/.dotfiles"
ENV PATH="${PATH}:/usr/local/bin/fn"
ENV PATH="${PATH}:${HOME}/.nix-profile/bin"
ENV PATH="${PATH}:/root/.pixi/bin"
# Used for Pinokio
ENV DISPLAY=:100
ENV GRADIO_SERVER_NAME="0.0.0.0"
#
# %setup
#
SHELL ["/bin/bash", "-c"]
RUN ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime \
&& echo "${TZ}" > /etc/timezone \
&& mkdir -p \
"${HOME}/.ssh" \
/tmp/scripts
#
# %files
#
COPY --chmod=0755 ./provision/scripts/dev/* /tmp/scripts
COPY --chmod=0755 ./provision/functions/* /usr/local/bin
ADD https://github.com/jhwohlgemuth/my-shell-setup.git "${DOTFILES}"
ADD "${S6_OVERLAY_GITHUB}/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz" /tmp
ADD "${S6_OVERLAY_GITHUB}/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz" /tmp
ADD "${S6_OVERLAY_GITHUB}/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz" /tmp
ADD "${S6_OVERLAY_GITHUB}/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz" /tmp
#
# %post
#
SHELL ["/bin/bash", "-c"]
RUN /tmp/scripts/install_dependencies.sh \
&& stow --dir "${DOTFILES}" --target "${HOME}" --stow git neovim ohmyposh powershell powerlevel10k \
&& /tmp/scripts/configure_locale.sh \
&& /tmp/scripts/install_dotnet.sh \
&& /tmp/scripts/install_ohmyzsh.sh \
&& /tmp/scripts/install_homebrew.sh \
&& /tmp/scripts/install_nix.sh && nix-env --install --file /tmp/scripts/manifest.nix \
&& mv /tmp/scripts/install_apptainer.sh /usr/local/bin/install_apptainer \
&& mv /tmp/scripts/install_cosmopolitan.sh /usr/local/bin/install_cosmopolitan \
&& mv /tmp/scripts/install_cuda.sh /usr/local/bin/install_cuda \
&& mv /tmp/scripts/install_docker.sh /usr/local/bin/install_docker \
&& mv /tmp/scripts/install_musl.sh /usr/local/bin/install_musl \
&& mv /tmp/scripts/install_pinokio.sh /usr/local/bin/install_pinokio \
&& mv /tmp/scripts/install_xr0.sh /usr/local/bin/install_xr0 \
&& mv /tmp/scripts/start_docker.sh /usr/local/bin/start_docker \
&& mv /tmp/scripts/start_pinokio.sh /usr/local/bin/start_pinokio \
&& /usr/bin/pwsh -Command /tmp/scripts/Install-Modules.ps1 \
&& eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" \
&& brew bundle --file /tmp/scripts/Brewfile \
&& brew cleanup --prune=all \
&& eval "$(pkgx integrate)" \
&& /tmp/scripts/configure_ohmyzsh.sh \
&& find "${NEOVIM_ROOT}" -name "*.vim" -print0 | xargs -0 dos2unix \
&& tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz \
&& tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz \
&& tar -C / -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz \
&& tar -C / -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz \
&& cleanup
#
# %runscript
#
WORKDIR /root/dev
HEALTHCHECK NONE
ENTRYPOINT [ "/init" ]
CMD ["/bin/zsh"]