Skip to content

Commit 089f5c5

Browse files
committed
Enhance Dockerfile to install dependencies and configure GitHub token; update workflow to pass token as build argument. Correct import path in root.go for whois package.
1 parent 674f360 commit 089f5c5

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636
uses: docker/build-push-action@v5
3737
with:
3838
context: .
39+
args: |
40+
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
3941
push: true
4042
tags: |
4143
${{ secrets.DOCKERHUB_USERNAME }}/whois:latest

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@
22
# All rights reserved.
33
FROM golang:alpine AS build
44

5-
WORKDIR /ws
5+
# Install dependencies
6+
RUN apk add --no-cache bash git
7+
8+
# Configure git to use the GitHub token
9+
ARG GITHUB_TOKEN
10+
RUN git config --global url."https://${GITHUB_TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
611

12+
WORKDIR /ws
713
COPY . /ws
814

915
ENV GO111MODULE=on
1016
ENV GCGO_ENABLED=0
1117
ENV GOARCH=amd64
1218
ENV GOOS=linux
1319

14-
RUN apk add --no-cache bash git
1520
RUN cd /ws && go mod tidy
1621

1722
# Build the app

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
homedir "github.com/mitchellh/go-homedir"
77
"github.com/bgpdata/whois/config"
8-
whois "github.com/obgpdata/whois/pkg/whois"
8+
whois "github.com/bgpdata/whois/pkg/whois"
99
log "github.com/sirupsen/logrus"
1010
"github.com/spf13/cobra"
1111
"github.com/spf13/viper"

0 commit comments

Comments
 (0)