-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.dev
85 lines (85 loc) · 2.8 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
# 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
ARG UID=1000
ARG GID=1000
#
# %environment
#
ENV VERSION="${VERSION}"
ENV TZ=America/New_York
ENV SHELL=/usr/bin/zsh
ENV TERM=xterm-256color
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
#
# Only supported by Apptainer
# Run setup commands outside of the container (on the host system) after the base image bootstrap.
#
# %files
#
ADD --chmod=0755 ./provision/dev/* /tmp/scripts/
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"]
WORKDIR "${HOME}"
RUN ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime && echo "${TZ}" > /etc/timezone \
&& /tmp/scripts/install_dependencies.sh \
&& curl -fsSL https://shell.jasonwohlgemuth.com/install.sh | bash \
&& install_dotnet \
&& install_ohmyzsh \
&& install_homebrew \
&& install_nix && nix-env --install --file /tmp/scripts/manifest.nix \
&& /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_locale.sh \
&& /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 \
&& addgroup --gid "${GID}" nonroot \
&& adduser --uid "${UID}" --gid "${GID}" --disabled-password --gecos "" nonroot \
&& echo 'nonroot ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers \
&& cleanup
#
# %runscript
#
WORKDIR "${HOME}/dev"
HEALTHCHECK NONE
ENTRYPOINT [ "/init" ]
CMD ["/bin/zsh"]