-
Notifications
You must be signed in to change notification settings - Fork 9
/
zsh-completion.Dockerfile
49 lines (32 loc) · 1.27 KB
/
zsh-completion.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
# Usage:
# ------
# DOCKER_BUILDKIT=true docker build -t hekmekk/git-team-zsh-completion -f zsh-completion.Dockerfile .
# docker run --rm -ti -v `pwd`/src/command/completion/script/zsh.sh:/src/git_team_completion.sh:ro hekmekk/git-team-zsh-completion
#
# % source git_team_completion.sh
# % git-team <tab> | git team <tab>
FROM golang:1.23-alpine
ENV RUNNING_IN_DOCKER=true
ENV USERNAME=git-team-zsh-completion
RUN apk update && \
apk add git zsh vim zsh-autosuggestions zsh-syntax-highlighting bind-tools curl go && \
rm -rf /var/cache/apk/*
RUN adduser -D ${USERNAME}
RUN sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
RUN echo "source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ~/.zshrc && \
echo "source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" >> ~/.zshrc
ENV GOPATH=/go
RUN mkdir -p ${GOPATH} && chown -R ${USERNAME} /go && chmod -R 2750 ${GOPATH}
USER ${USERNAME}
ENV PATH=${GOPATH}/bin:$PATH
WORKDIR /git-team
COPY go.mod .
COPY go.sum .
COPY main.go .
COPY src ./src
RUN go mod download
RUN go install ./...
RUN echo "autoload -U +X compinit && compinit" >> /home/${USERNAME}/.zshrc
VOLUME /src/git_team_completion.sh
WORKDIR /src
ENTRYPOINT ["/bin/zsh"]