Skip to content

Commit

Permalink
Update Docker builder
Browse files Browse the repository at this point in the history
  • Loading branch information
Motok1 committed Jun 8, 2024
1 parent 60942ed commit 27753ad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Push Docker image
on:
push:
branches-ignore:
- '**'
- "**"
tags:
- 'v*'
- "v*"

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -46,7 +46,8 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./build/package
context: .
file: ./build/package/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
22 changes: 11 additions & 11 deletions build/package/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
FROM ubuntu:22.04
FROM golang:1.22.4
LABEL maintainer "Motoki TAKENAKA <m.takenaka@ntt.com>"

WORKDIR /pola

COPY . .

# Install packages
RUN apt-get update \
&& apt-get install -y bash-completion curl iproute2

# Setup Go 1.22.2
RUN curl -o ~/go1.22.2.linux-amd64.tar.gz -LO https://go.dev/dl/go1.22.2.linux-amd64.tar.gz \
&& rm -rf /usr/local/go \
&& tar -C /usr/local -xzf ~/go1.22.2.linux-amd64.tar.gz \
&& echo "export PATH=$PATH:/usr/local/go/bin" > ~/.bashrc
&& apt-get install -y bash-completion curl iproute2 wget vim iputils-ping net-tools

# Enable Completion
RUN echo "" >> ~/.bashrc \
Expand All @@ -18,10 +16,12 @@ RUN echo "" >> ~/.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
SHELL ["/bin/bash", "-c"]
RUN go install ./cmd/...

# remove build directory
RUN rm -rf ./*

# Add completion
RUN pola completion bash | tee -a /usr/share/bash-completion/completions/pola >/dev/null \
Expand Down

0 comments on commit 27753ad

Please sign in to comment.