mirror of
https://github.com/outbackdingo/ghorg.git
synced 2026-01-27 10:19:03 +00:00
Add Dockerfile
This commit is contained in:
@@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
|
||||
## [1.7.12] - unreleased
|
||||
### Added
|
||||
- Dockerfile
|
||||
### Changed
|
||||
### Deprecated
|
||||
### Removed
|
||||
|
||||
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
||||
FROM golang:alpine
|
||||
|
||||
# Install dependencies for copy
|
||||
RUN apk add -U --no-cache ca-certificates tzdata git
|
||||
|
||||
WORKDIR /go/src/github.com/gabrie30/ghorg
|
||||
COPY . .
|
||||
|
||||
# Fetching dependencies and build the app
|
||||
RUN go get -d -v ./...
|
||||
RUN CGO_ENABLED=0 go build -a --mod vendor -o ghorg .
|
||||
19
README.md
19
README.md
@@ -95,6 +95,25 @@ go install github.com/gabrie30/ghorg@latest
|
||||
go get github.com/gabrie30/ghorg
|
||||
```
|
||||
|
||||
### Docker
|
||||
|
||||
> This is only recommended for testing due to resource constraints
|
||||
|
||||
1. Clone repo then `cd ghorg`
|
||||
1. Build the image `docker build . -t ghorg-docker`
|
||||
1. Run in docker
|
||||
|
||||
```bash
|
||||
# Using your local ghorg configuration file, cloning in container
|
||||
docker run -v $HOME/.config/ghorg/conf.yaml:/root/.config/ghorg/conf.yaml ghorg-docker ./ghorg clone kubernetes
|
||||
|
||||
# Using flags, cloning in container
|
||||
docker run ghorg-docker ./ghorg clone kubernetes --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2
|
||||
|
||||
# Using flags, cloning to your machine
|
||||
docker run -v $HOME/ghorg/:/root/ghorg/ ghorg-docker ./ghorg clone kubernetes --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2 --output-dir=cloned-from-docker
|
||||
```
|
||||
|
||||
## Use
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user