-
Notifications
You must be signed in to change notification settings - Fork 0
/
debian.Dockerfile
108 lines (92 loc) · 3.84 KB
/
debian.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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
ARG DEBIAN_VERSION=12-slim
ARG DOCKER_VERSION=v25.0.2
ARG COMPOSE_VERSION=v2.24.5
ARG BUILDX_VERSION=v0.12.1
ARG LOGOLS_VERSION=v1.3.7
ARG BIT_VERSION=v1.1.2
ARG GH_VERSION=v2.43.1
ARG DEVTAINR_VERSION=v0.6.0
FROM qmcgaw/binpot:docker-${DOCKER_VERSION} AS docker
FROM qmcgaw/binpot:compose-${COMPOSE_VERSION} AS compose
FROM qmcgaw/binpot:buildx-${BUILDX_VERSION} AS buildx
FROM qmcgaw/binpot:logo-ls-${LOGOLS_VERSION} AS logo-ls
FROM qmcgaw/binpot:bit-${BIT_VERSION} AS bit
FROM qmcgaw/binpot:gh-${GH_VERSION} AS gh
FROM qmcgaw/devtainr:${DEVTAINR_VERSION} AS devtainr
FROM debian:${DEBIAN_VERSION}
ARG CREATED
ARG COMMIT
ARG VERSION=local
LABEL \
org.opencontainers.image.authors="quentin.mcgaw@gmail.com" \
org.opencontainers.image.created=$CREATED \
org.opencontainers.image.version=$VERSION \
org.opencontainers.image.revision=$COMMIT \
org.opencontainers.image.url="https://github.com/qdm12/basedevcontainer" \
org.opencontainers.image.documentation="https://github.com/qdm12/basedevcontainer" \
org.opencontainers.image.source="https://github.com/qdm12/basedevcontainer" \
org.opencontainers.image.title="Base Dev container Debian" \
org.opencontainers.image.description="Base Debian development container for Visual Studio Code Remote Containers development"
ENV BASE_VERSION="${VERSION}-${CREATED}-${COMMIT}"
# CA certificates
RUN apt-get update -y && \
apt-get install -y --no-install-recommends ca-certificates && \
rm -r /var/cache/* /var/lib/apt/lists/*
# Timezone
RUN apt-get update -y && \
apt-get install -y --no-install-recommends tzdata && \
rm -r /var/cache/* /var/lib/apt/lists/*
ENV TZ=
# Setup Git and SSH
# Workaround for older Debian in order to be able to sign commits
RUN echo "deb https://deb.debian.org/debian bookworm main" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y --no-install-recommends -t bookworm git git-man && \
rm -r /var/cache/* /var/lib/apt/lists/*
RUN apt-get update -y && \
apt-get install -y --no-install-recommends man openssh-client less && \
rm -r /var/cache/* /var/lib/apt/lists/*
COPY .ssh.sh /root/
RUN chmod +x /root/.ssh.sh
# Retro-compatibility symlink
RUN ln -s /root/.ssh.sh /root/.windows.sh
# Setup shell
ENTRYPOINT [ "/bin/zsh" ]
RUN apt-get update -y && \
apt-get install -y --no-install-recommends zsh nano locales wget && \
apt-get autoremove -y && \
apt-get clean -y && \
rm -r /var/cache/* /var/lib/apt/lists/*
ENV EDITOR=nano \
LANG=en_US.UTF-8 \
# MacOS compatibility
TERM=xterm
RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment && \
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
echo "LANG=en_US.UTF-8" > /etc/locale.conf && \
locale-gen en_US.UTF-8
RUN usermod --shell /bin/zsh root
COPY shell/.zshrc shell/.welcome.sh /root/
RUN git clone --single-branch --depth 1 https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
ARG POWERLEVEL10K_VERSION=v1.16.1
COPY shell/.p10k.zsh /root/
RUN git clone --branch ${POWERLEVEL10K_VERSION} --single-branch --depth 1 https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/custom/themes/powerlevel10k && \
rm -rf ~/.oh-my-zsh/custom/themes/powerlevel10k/.git
# Docker CLI
COPY --from=docker /bin /usr/local/bin/docker
ENV DOCKER_BUILDKIT=1
# Docker compose
COPY --from=compose /bin /usr/libexec/docker/cli-plugins/docker-compose
ENV COMPOSE_DOCKER_CLI_BUILD=1
RUN echo "alias docker-compose='docker compose'" >> /root/.zshrc
# Buildx plugin
COPY --from=buildx /bin /usr/libexec/docker/cli-plugins/docker-buildx
# Logo ls
COPY --from=logo-ls /bin /usr/local/bin/logo-ls
RUN echo "alias ls='logo-ls'" >> /root/.zshrc
# Bit
COPY --from=bit /bin /usr/local/bin/bit
ARG TARGETPLATFORM
RUN if [ "${TARGETPLATFORM}" != "linux/s390x" ]; then echo "y" | bit complete; fi
COPY --from=gh /bin /usr/local/bin/gh
COPY --from=devtainr /devtainr /usr/local/bin/devtainr