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

build: change base image to alpine #155

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ COPY . ./
RUN CGO_ENABLED=0 GOOS=linux go build -o /reviewbot .

RUN GOPATH=/go go install honnef.co/go/tools/cmd/staticcheck@2023.1.6
RUN GOPATH=/go go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1

FROM ubuntu:22.04 as runner
FROM alpine:3.20 as runner

# if you want to install other tools, please add them here
RUN apt-get update && apt-get install -y ca-certificates luarocks cppcheck shellcheck dnsutils curl git wget vim htop jq telnet iputils-ping \
&& luarocks install luacheck \
&& rm -rf /var/lib/apt/lists/* \
&& curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/local/bin v1.59.0

RUN set -eux \
apk update && \
apk --no-cache add ca-certificates luacheck cppcheck shellcheck curl htop vim less wget git lsof inetutils-telnet jq tmux
WORKDIR /

COPY --from=builder /reviewbot /reviewbot
COPY --from=builder /go/bin/staticcheck /usr/local/bin/staticcheck
COPY --from=builder /go/bin/golangci-lint /usr/local/bin/golangci-lint

# SSH config
RUN mkdir -p /root/.ssh && chown -R root /root/.ssh/ && chgrp -R root /root/.ssh/ \
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,10 @@ build: check-go
docker-build: check-docker
docker builder build --push -t $(DOCKER_IMAGE):$(VERSION) --target runner .


docker-dev: check-docker
docker builder build -t $(DOCKER_IMAGE):dev --target runner .


docker-deploy: check-kubectl docker-build
kubectl apply -k .
Loading