This repository has been archived by the owner on Apr 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
feat: add Dockerfile and Makefile #53
Open
sublimino
wants to merge
1
commit into
ipfs-inactive:master
Choose a base branch
from
sublimino:dockerfile
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
tag_annotation | ||
coverage.out | ||
ipfs-cluster-service/ipfs-cluster-service | ||
ipfs-cluster-ctl/ipfs-cluster-ctl | ||
deptools | ||
sharness/lib/sharness | ||
sharness/test-results | ||
sharness/trash* | ||
|
||
raftFolderFromTest* | ||
peerstore | ||
|
||
# Compiled Object files, Static and Dynamic libs (Shared Objects) | ||
*.o | ||
*.a | ||
*.so | ||
|
||
# Folders | ||
_obj | ||
_test | ||
test/sharness/test-results | ||
test/sharness/trash* | ||
test/sharness/lib/sharness | ||
test/sharness/.test_config | ||
test/sharness/.test_ipfs | ||
|
||
# Architecture specific extensions/prefixes | ||
*.[568vq] | ||
[568vq].out | ||
|
||
*.cgo1.go | ||
*.cgo2.c | ||
_cgo_defun.c | ||
_cgo_gotypes.go | ||
_cgo_export.* | ||
|
||
_testmain.go | ||
|
||
*.exe | ||
*.test | ||
*.prof | ||
|
||
.gx/ | ||
.snapcraft/ | ||
ipfs-cluster/ | ||
|
||
Dockerfile* | ||
Jenkinsfile* | ||
.git/ | ||
.idea/ | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM instrumentisto/dep:0.4.1 AS builder | ||
ENV GOPATH /go | ||
ENV SRC_PATH $GOPATH/src/github.com/ipfs/kubernetes-ipfs | ||
WORKDIR $SRC_PATH | ||
|
||
COPY . $SRC_PATH | ||
RUN \ | ||
dep init -v \ | ||
&& dep ensure -v \ | ||
&& go build | ||
|
||
# === | ||
|
||
FROM busybox:1-glibc | ||
ENV GOPATH /go | ||
|
||
COPY --from=builder \ | ||
/go/src/github.com/ipfs/kubernetes-ipfs /code/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
NAME := kubernetes-ipfs | ||
REGISTRY := docker.io/controlplane | ||
GIT_TAG ?= $(shell bash -c 'TAG=$$(git tag | tail -n1); echo "$${TAG:-none}"') | ||
|
||
CONTAINER_TAG ?= $(GIT_TAG) | ||
CONTAINER_NAME := $(REGISTRY)/$(NAME):$(CONTAINER_TAG) | ||
CONTAINER_NAME_LATEST := $(REGISTRY)/$(NAME):latest | ||
|
||
all: help | ||
|
||
docker-build: ## builds the test docker image | ||
@echo "+ $@" | ||
docker build -f Dockerfile --tag "$(CONTAINER_NAME)" . | ||
docker tag "$(CONTAINER_NAME)" "$(CONTAINER_NAME_LATEST)" | ||
@echo "Successfully tagged $(CONTAINER_NAME) as $(CONTAINER_NAME_LATEST)" | ||
|
||
docker-push: ## pushes the docker image | ||
@echo "+ $@" | ||
docker push "$(CONTAINER_NAME)" | ||
docker push "$(CONTAINER_NAME_LATEST)" | ||
|
||
help: ## parse jobs and descriptions from this Makefile | ||
@grep -E '^[ a-zA-Z0-9_-]+:([^=]|$$)' $(MAKEFILE_LIST) \ | ||
| grep -Ev '^help\b[[:space:]]*:' \ | ||
| sort \ | ||
| awk 'BEGIN {FS = ":.*?##"}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better use official golang Go images. That way someone reading this dockerfile doesn't have to go figure out what instrumentisto images do. The build process is simple enough to be able to use a vanilla approach.