Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile #32

Merged
merged 1 commit into from
Nov 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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