mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
add explicit version to Dockerfile, circleci
This commit is contained in:
parent
0ac70c96eb
commit
b3cdb33efc
@ -1,7 +1,10 @@
|
|||||||
FROM quay.io/vektorcloud/glibc:latest
|
FROM quay.io/vektorcloud/glibc:latest
|
||||||
|
|
||||||
RUN ctop_url=$(wget -q -O - https://api.github.com/repos/bcicen/ctop/releases/latest | grep 'browser_' | cut -d\" -f4 |grep 'linux-amd64') && \
|
ARG CTOP_VERSION=0.4.1
|
||||||
wget -q $ctop_url -O /ctop && \
|
ENV CTOP_URL https://github.com/bcicen/ctop/releases/download/v${CTOP_VERSION}/ctop-${CTOP_VERSION}-linux-amd64
|
||||||
|
|
||||||
|
RUN echo $CTOP_URL && \
|
||||||
|
wget -q $CTOP_URL -O /ctop && \
|
||||||
chmod +x /ctop
|
chmod +x /ctop
|
||||||
|
|
||||||
ENTRYPOINT ["/ctop"]
|
ENTRYPOINT ["/ctop"]
|
||||||
|
10
circle.yml
10
circle.yml
@ -1,15 +1,18 @@
|
|||||||
machine:
|
machine:
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
|
environment:
|
||||||
|
VERSION: $(cat VERSION)
|
||||||
|
IMAGE_NAME: quay.io/vektorlab/ctop
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
override:
|
override:
|
||||||
- docker info
|
- docker info
|
||||||
- |
|
- |
|
||||||
if [[ "$CIRCLE_BRANCH" == "master" ]]; then
|
if [[ "$CIRCLE_BRANCH" == "master" ]]; then
|
||||||
docker build -t quay.io/vektorlab/ctop:latest .
|
docker build --build-arg CTOP_VERSION=${VERSION} -t ${IMAGE_NAME}:latest .
|
||||||
else
|
else
|
||||||
docker build -t quay.io/vektorlab/ctop:${CIRCLE_BRANCH} .
|
docker build --build-arg CTOP_VERSION=${VERSION} -t ${IMAGE_NAME}:${CIRCLE_BRANCH} .
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@ -20,5 +23,6 @@ deployment:
|
|||||||
hub:
|
hub:
|
||||||
branch: master
|
branch: master
|
||||||
commands:
|
commands:
|
||||||
|
- docker tag ${IMAGE_NAME}:latest ${IMAGE_NAME}:${VERSION}
|
||||||
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS quay.io
|
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS quay.io
|
||||||
- docker push quay.io/vektorlab/ctop:latest
|
- docker push ${IMAGE_NAME}
|
||||||
|
6
main.go
6
main.go
@ -25,6 +25,9 @@ var (
|
|||||||
func main() {
|
func main() {
|
||||||
defer panicExit()
|
defer panicExit()
|
||||||
|
|
||||||
|
// init global config
|
||||||
|
config.Init()
|
||||||
|
|
||||||
// parse command line arguments
|
// parse command line arguments
|
||||||
var versionFlag = flag.Bool("v", false, "output version information and exit")
|
var versionFlag = flag.Bool("v", false, "output version information and exit")
|
||||||
var helpFlag = flag.Bool("h", false, "display this help dialog")
|
var helpFlag = flag.Bool("h", false, "display this help dialog")
|
||||||
@ -51,9 +54,6 @@ func main() {
|
|||||||
}
|
}
|
||||||
defer ui.Close()
|
defer ui.Close()
|
||||||
|
|
||||||
// init global config
|
|
||||||
config.Init()
|
|
||||||
|
|
||||||
// override default config values with command line flags
|
// override default config values with command line flags
|
||||||
if *filterFlag != "" {
|
if *filterFlag != "" {
|
||||||
config.Update("filterStr", *filterFlag)
|
config.Update("filterStr", *filterFlag)
|
||||||
|
Loading…
Reference in New Issue
Block a user