Skip to content

Commit

Permalink
Merge pull request #32 from nttcom/feature/add_dockerfile
Browse files Browse the repository at this point in the history
Add Dockerfile
  • Loading branch information
watal committed Nov 21, 2022
2 parents 814a740 + b4ab3e8 commit ffed354
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions build/package/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM ubuntu:22.04
LABEL maintainer "Motoki TAKENAKA <m.takenaka@ntt.com>"

# 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

0 comments on commit ffed354

Please sign in to comment.