From b4ab3e889267ea5be226ad66f9fdddf7e2ceba9f Mon Sep 17 00:00:00 2001 From: Motok1 Date: Fri, 18 Nov 2022 08:38:07 +0000 Subject: [PATCH] add Dockerfile --- build/package/Dockerfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 build/package/Dockerfile diff --git a/build/package/Dockerfile b/build/package/Dockerfile new file mode 100644 index 0000000..3660220 --- /dev/null +++ b/build/package/Dockerfile @@ -0,0 +1,28 @@ +FROM ubuntu:22.04 +LABEL maintainer "Motoki TAKENAKA " + +# Install packages +RUN apt-get update \ + && apt-get install -y bash-completion curl iproute2 + +# Setup Go 1.18.8 +RUN curl -o ~/go1.18.8.linux-amd64.tar.gz -LO https://go.dev/dl/go1.18.8.linux-amd64.tar.gz \ + && rm -rf /usr/local/go \ + && tar -C /usr/local -xzf ~/go1.18.8.linux-amd64.tar.gz \ + && echo "export PATH=$PATH:/usr/local/go/bin" > ~/.bashrc + +# Enable Completion +RUN echo "" >> ~/.bashrc \ + && echo "if [ -f /etc/bash_completion ] && ! shopt -oq posix; then" >> ~/.bashrc \ + && echo " . /etc/bash_completion" >> ~/.bashrc \ + && echo "fi" >> ~/.bashrc + +# Install Pola +SHELL ["/bin/bash", "-l", "-c"] + +ENV GOBIN /usr/local/go/bin +RUN go install github.com/nttcom/pola/cmd/...@latest + +# Add completion +RUN pola completion bash | tee -a /usr/share/bash-completion/completions/pola >/dev/null \ + && source /usr/share/bash-completion/completions/pola