-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathalpine.Dockerfile
95 lines (77 loc) · 3.13 KB
/
alpine.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
ARG ALPINE_VERSION=3.20
ARG DOCKER_VERSION=v27.3.1
ARG COMPOSE_VERSION=v2.29.7
ARG BUILDX_VERSION=v0.17.1
ARG LOGOLS_VERSION=v1.3.7
ARG BIT_VERSION=v1.1.2
ARG GH_VERSION=v2.58.0
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 alpine:${ALPINE_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" \
org.opencontainers.image.description="Base Alpine development container for Visual Studio Code Dev Containers development"
ENV BASE_VERSION="${VERSION}-${CREATED}-${COMMIT}"
# CA certificates
RUN apk add -q --update --progress --no-cache ca-certificates
# Timezone
RUN apk add -q --update --progress --no-cache tzdata
ENV TZ=
# Setup Git and SSH
RUN apk add -q --update --progress --no-cache git mandoc git-doc openssh-client
COPY .ssh.sh /root/
RUN chmod +x /root/.ssh.sh
# Retro-compatibility symlink
RUN ln -s /root/.ssh.sh /root/.windows.sh
WORKDIR /root
# Setup shell for root and ${USERNAME}
ENTRYPOINT [ "/bin/zsh" ]
RUN apk add -q --update --progress --no-cache zsh nano zsh-vcs
ENV EDITOR=nano \
LANG=en_US.UTF-8 \
# MacOS compatibility
TERM=xterm
RUN apk add -q --update --progress --no-cache shadow && \
usermod --shell /bin/zsh root && \
apk del shadow
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
COPY shell/.p10k.zsh /root/
RUN apk add -q --update --progress --no-cache zsh-theme-powerlevel10k gitstatus && \
ln -s /usr/share/zsh/plugins/powerlevel10k ~/.oh-my-zsh/custom/themes/powerlevel10k
# 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
# VSCode specific (speed up setup)
RUN apk add -q --update --progress --no-cache libstdc++