Skip to content

Commit f994999

Browse files
committed
Add Docerfile
1 parent 2f41a8a commit f994999

6 files changed

Lines changed: 34 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55

66
## [Unreleased]
77

8+
## [v0.9.1] - 2021-03-14
9+
### Added
10+
- Added Dockerfile.
11+
12+
### Changed
13+
- Disabled CGO in release script.
14+
815
## [v0.9.0] - 2020-12-20
916
### Added
1017
- Added config validation.
@@ -86,7 +93,8 @@ than entry in configuration file.
8693
### Added
8794
- Initial implementation.
8895

89-
[Unreleased]: https://github.com/gorcon/rcon-cli/compare/v0.9.0...HEAD
96+
[Unreleased]: https://github.com/gorcon/rcon-cli/compare/v0.9.1...HEAD
97+
[v0.9.1]: https://github.com/gorcon/rcon-cli/compare/v0.9.0...v0.9.1
9098
[v0.9.0]: https://github.com/gorcon/rcon-cli/compare/v0.8.1...v0.9.0
9199
[v0.8.1]: https://github.com/gorcon/rcon-cli/compare/v0.8.0-beta.2...v0.8.1
92100
[v0.8.0-beta.2]: https://github.com/gorcon/rcon-cli/compare/v0.8.0-beta...v0.8.0-beta.2

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM scratch
2+
MAINTAINER Pavel Korotkiy <paul.korotkiy@gmail.com>
3+
4+
COPY LICENSE /
5+
COPY README.md /
6+
COPY CHANGELOG.md /
7+
COPY rcon.yaml /
8+
COPY rcon-cli /rcon
9+
10+
CMD ["/rcon"]

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Pavel Korotkiy (outdead)
3+
Copyright (c) 2021 Pavel Korotkiy (outdead)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![top level coverage](https://gocover.io/_badge/github.com/gorcon/rcon-cli?0)](https://gocover.io/github.com/gorcon/rcon-cli)
44
[![Go Report Card](https://goreportcard.com/badge/github.com/gorcon/rcon-cli)](https://goreportcard.com/report/github.com/gorcon/rcon-cli)
55
[![GitHub All Releases](https://img.shields.io/github/downloads/gorcon/rcon-cli/total)](https://github.com/gorcon/rcon-cli/releases)
6+
[![Docker Pulls](https://img.shields.io/docker/pulls/outdead/rcon.svg)](https://hub.docker.com/r/outdead/rcon)
67

78
CLI for executing queries on a remote [Source dedicated game server](https://developer.valvesoftware.com/wiki/Source_Dedicated_Server), using the [RCON](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol) protocol.
89

@@ -22,6 +23,10 @@ Download the binary for your platform from the [latest releases](https://github.
2223

2324
See [Changelog](CHANGELOG.md) for release details
2425

26+
### Docker
27+
28+
docker pull outdead/rcon
29+
2530
## Usage
2631

2732
```text

internal/logger/logger.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ func OpenFile(name string) (file *os.File, err error) {
2525
switch _, err = os.Stat(name); {
2626
case err == nil:
2727
file, err = os.OpenFile(name, os.O_APPEND|os.O_WRONLY, 0666)
28+
if err != nil {
29+
return file, fmt.Errorf("open: %w", err)
30+
}
2831
case os.IsNotExist(err):
2932
file, err = os.Create(name)
30-
}
31-
32-
if err != nil {
33-
return file, fmt.Errorf("open: %w", err)
33+
if err != nil {
34+
return file, fmt.Errorf("create: %w", err)
35+
}
3436
}
3537

3638
return file, nil

release.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ function make_release() {
2424
local dir="release/${release_name}"
2525

2626
mkdir -p "${dir}"
27-
env GOARCH="${arch}" GOOS="${os}" go build -ldflags "-s -w -X main.Version=${VERSION}" -o "${dir}/rcon${ext}"
28-
#upx-ucl --best "${dir}/rcon${ext}" -o "${dir}/rcon-upx${ext}"
27+
env GOARCH="${arch}" GOOS="${os}" CGO_ENABLED=0 go build -ldflags "-s -w -X main.Version=${VERSION}" -o "${dir}/rcon${ext}"
2928

3029
cp LICENSE "${dir}"
3130
cp README.md "${dir}"
@@ -52,3 +51,5 @@ make_release amd64 linux "rcon-${VERSION}-amd64_linux"
5251
make_release 386 windows "rcon-${VERSION}-win32" .exe
5352
make_release amd64 windows "rcon-${VERSION}-win64" .exe
5453
make_release amd64 darwin "rcon-${VERSION}-amd64_darwin"
54+
55+
env GOARCH="amd64" GOOS="linux" CGO_ENABLED=0 go build -ldflags "-s -w -X main.Version=${VERSION}"

0 commit comments

Comments
 (0)