Kaynağa Gözat

update stackname/Dockerfile

krrish 7 yıl önce
ebeveyn
işleme
cf538f7048

+ 0 - 40
ng-docker-example/stackname/Dockerfile

@@ -1,40 +0,0 @@
-# build: docker build -t <registry>/<product>/<app>:<version> .
-# push : docker push <registry>/<product>/<app>:<version>
-
-FROM tyn.ar3qvx.com/os/svi-centos7:latest
-MAINTAINER krrish krrishdo@gmail.com
-
-ENV APP_NAME="evlss" \
-    APP_HOME="/opt/wisecloud/cdn" \
-    APP_PACKAGE_URL="dist/*.tar.gz"
-# packge location can be file、http(s)、ftp...
-# file:///tmp/file.tar.gz
-# https://svicloud.s3.amazonaws.com/evlss.tar.gz
-
-
-## config and start files
-ADD docker/start.sh /usr/local/bin/
-ADD docker/conf     /usr/local/conf/
-RUN chmod a+x  /usr/local/bin/* && \
-    touch      /var/log/${APP_NAME}.log
-
-# if APP_PACKAGE_URL use http or ftp
-#RUN curl -sSL ${APP_PACKAGE_URL} | \
-#    tar zxvf - -C ${APP_HOME}
-    
-ADD $APP_PACKAGE_URL /tmp
-RUN cd /tmp/*release*/ && \
-    echo -e "yes\n" | bash setup.sh -i -n
-
-
-WORKDIR ${APP_HOME}/${APP_NAME}
-
-
-# Port to be exposed
-EXPOSE 1935 8035 13818 19850
-
-# Init
-ENTRYPOINT ["tini", "--"]
-
-# Startup
-CMD ["start.sh"]

+ 9 - 5
ng-docker-example/stackname/Dockerfile.dapper

@@ -5,13 +5,14 @@ ARG DAPPER_HOST_ARCH
 ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
 
 RUN apt-get update && \
-    apt-get install -y gcc ca-certificates git wget curl vim less file && \
+    apt-get install -y gcc ca-certificates git wget curl vim less file xz-utils unzip && \
+    curl -sLf https://github.com/rancher/machine-package/releases/download/v0.13.0-rancher2/docker-machine.tar.gz | tar xvzf - -C /usr/bin && \
     rm -f /bin/sh && ln -s /bin/bash /bin/sh
 
 ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH=GOLANG_ARCH_${ARCH} \
     GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash
 
-RUN wget -O - https://storage.googleapis.com/golang/go1.8.3.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local && \
+RUN wget -O - https://storage.googleapis.com/golang/go1.9.2.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local && \
     go get github.com/rancher/trash && go get github.com/golang/lint/golint
 
 ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \
@@ -20,7 +21,11 @@ ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \
 
 RUN wget -O - ${!DOCKER_URL} > /usr/bin/docker && chmod +x /usr/bin/docker
 
-ENV DAPPER_SOURCE /go/src/github.com/rancher/external-dns/
+RUN apt-get update && \
+    apt-get install -y tox python2.7
+
+ENV DAPPER_ENV REPO TAG DRONE_TAG
+ENV DAPPER_SOURCE /go/src/github.com/rancher/rancher/
 ENV DAPPER_OUTPUT ./bin ./dist
 ENV DAPPER_DOCKER_SOCKET true
 ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache
@@ -28,5 +33,4 @@ ENV HOME ${DAPPER_SOURCE}
 WORKDIR ${DAPPER_SOURCE}
 
 ENTRYPOINT ["./scripts/entry"]
-CMD ["ci"]
-
+CMD ["ci"]

+ 198 - 0
ng-docker-example/stackname/Makefile.example

@@ -0,0 +1,198 @@
+Skip to content
+This repository
+Search
+Pull requests
+Issues
+Marketplace
+Explore
+ @dongcj
+Sign out
+1
+1 6 dmportella/powerdns
+forked from jgreat/powerdns
+ Code  Issues 1  Pull requests 0  Projects 0  Insights
+powerdns/makefile
+7cb21fd  on 12 May 2017
+@dmportella dmportella updated vet code
+
+168 lines (135 sloc)  6.39 KB
+APPNAME?="powerdns"
+REPONAME?="dmportella"
+TEST?=$$(go list ./... | grep -v '/vendor/')
+VETARGS?=-all
+GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
+REV?=$$(git rev-parse --short HEAD)
+BRANCH?=$$(git rev-parse --abbrev-ref HEAD)
+BUILDFILES?=$$(find bin -mindepth 1 -maxdepth 1 -type f)
+VERSION?="0.0.0"
+DOCKER_REPO?="${REPONAME}/${APPNAME}"
+TOKEN?=""
+XC_OS=$$(go env GOOS)
+XC_ARCH=$$(go env GOARCH)
+
+default: lazy
+
+lazy: version fmt lint vet test
+
+# Git commands
+save:
+  @git add -A
+  @git commit -S
+  @git status
+
+push:
+  @git push origin ${BRANCH}
+
+subtree-pull:
+  @git log | grep git-subtree-dir | awk '{print $2}'
+  @git subtree pull --prefix=website/public git@github.com:${REPONAME}/${APPNAME}.git gh-pages
+
+subtree-push:
+  @git log | grep git-subtree-dir | awk '{print $2}'
+  @git subtree push --prefix=website/public git@github.com:${REPONAME}/${APPNAME}.git gh-pages
+
+update:
+  @git pull origin ${BRANCH}
+
+vendor:
+  @govendor add +external
+
+vendor-update:
+  @govendor update +external
+
+version:
+  @echo "SOFTWARE VERSION"
+  @echo "\tbranch:\t\t" ${BRANCH}
+  @echo "\trevision:\t" ${REV}
+  @echo "\tversion:\t" ${VERSION}
+
+ci: tools build
+  @echo "CI BUILD..."
+
+tools:
+  @echo "GO TOOLS installation..."
+  @go get -u github.com/kardianos/govendor
+  @go get -u golang.org/x/tools/cmd/cover
+  @go get -u github.com/golang/lint/golint
+
+build: version test
+  @echo "GO BUILD..."
+  @CGO_ENABLED=0 go build -ldflags "-s -X main.Build=${VERSION} -X main.Revision=${REV} -X main.Branch=${BRANCH} -X main.OSArch=${XC_OS}/${XC_ARCH}" -v -o ./bin/${APPNAME} .
+
+buildonly:
+  @CGO_ENABLED=0 go build -ldflags "-s -X main.Build=${VERSION} -X main.Revision=${REV} -X main.Branch=${BRANCH} -X main.OSArch=${XC_OS}/${XC_ARCH}" -v -o ./bin/${APPNAME} .
+
+crosscompile: linux-build darwin-build freebsd-build windows-build tar-everything shasums
+  @echo "crosscompile done..."
+
+docker:
+  @if [ -e "bin/linux-amd64/${APPNAME}" ]; then \
+    docker build -t ${DOCKER_REPO}:${VERSION} -q --build-arg CONT_IMG_VER=${VERSION} --build-arg BINARY=bin/linux-amd64/${APPNAME} . ; \
+    docker tag ${DOCKER_REPO}:${VERSION} ${DOCKER_REPO}:latest ; \
+  else \
+    echo "Please run crosscompile before running docker command." ; \
+    exit 1 ; \
+  fi
+
+docker-run:
+  @docker run -it --rm -v /etc/ssl/certs/:/etc/ssl/certs/ --name ${APPNAME} ${DOCKER_REPO}:latest -t ${TOKEN} -verbose
+
+tar-everything:
+  @echo "tar-everything..."
+  @tar -zcvf bin/${APPNAME}-linux-386-${VERSION}.tgz bin/linux-386
+  @tar -zcvf bin/${APPNAME}-linux-amd64-${VERSION}.tgz bin/linux-amd64
+  @tar -zcvf bin/${APPNAME}-linux-arm-${VERSION}.tgz bin/linux-arm
+  @tar -zcvf bin/${APPNAME}-darwin-386-${VERSION}.tgz bin/darwin-386
+  @tar -zcvf bin/${APPNAME}-darwin-amd64-${VERSION}.tgz bin/darwin-amd64
+  @tar -zcvf bin/${APPNAME}-freebsd-386-${VERSION}.tgz bin/freebsd-386
+  @tar -zcvf bin/${APPNAME}-freebsd-amd64-${VERSION}.tgz bin/freebsd-amd64
+  @zip -9 -y -r bin/${APPNAME}-windows-386-${VERSION}.zip bin/windows-386
+  @zip -9 -y -r bin/${APPNAME}-windows-amd64-${VERSION}.zip bin/windows-amd64
+
+shasums:
+  @shasum -a 256 $(BUILDFILES) > bin/${APPNAME}-${VERSION}.shasums
+
+gpg:
+  @gpg --output bin/${APPNAME}-${VERSION}.sig --detach-sig bin/${APPNAME}-${VERSION}.shasums
+
+gpg-verify:
+  @gpg --verify bin/${APPNAME}-${VERSION}.sig bin/${APPNAME}-${VERSION}.shasums
+
+linux-build:
+  @echo "linux build... 386"
+  @CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags "-s -X main.Build=${VERSION} -X main.Revision=${REV} -X main.Branch=${BRANCH} -X main.OSArch=linux/386" -v -o ./bin/linux-386/${APPNAME} . 2>/dev/null
+  @echo "linux build... amd64"
+  @CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -X main.Build=${VERSION} -X main.Revision=${REV} -X main.Branch=${BRANCH} -X main.OSArch=linux/amd64" -v -o ./bin/linux-amd64/${APPNAME} . 2>/dev/null
+  @echo "linux build... arm"
+  @CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -ldflags "-s -X main.Build=${VERSION} -X main.Revision=${REV} -X main.Branch=${BRANCH} -X main.OSArch=linux/arm" -v -o ./bin/linux-arm/${APPNAME} . 2>/dev/null
+
+darwin-build:
+  @echo "darwin build... 386"
+  @CGO_ENABLED=0 GOOS=darwin GOARCH=386 go build -ldflags "-s -X main.Build=${VERSION} -X main.Revision=${REV} -X main.Branch=${BRANCH} -X main.OSArch=darwin/386" -v -o ./bin/darwin-386/${APPNAME} . 2>/dev/null
+  @echo "darwin build... amd64"
+  @CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-s -X main.Build=${VERSION} -X main.Revision=${REV} -X main.Branch=${BRANCH} -X main.OSArch=darwin/amd64" -v -o ./bin/darwin-amd64/${APPNAME} . 2>/dev/null
+
+freebsd-build:
+  @echo "freebsd build... 386"
+  @CGO_ENABLED=0 GOOS=freebsd GOARCH=386 go build -ldflags "-s -X main.Build=${VERSION} -X main.Revision=${REV} -X main.Branch=${BRANCH} -X main.OSArch=freebsd/386" -v -o ./bin/freebsd-386/${APPNAME} . 2>/dev/null
+  @echo "freebsd build... amd64"
+  @CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -ldflags "-s -X main.Build=${VERSION} -X main.Revision=${REV} -X main.Branch=${BRANCH} -X main.OSArch=freebsd/amd64" -v -o ./bin/freebsd-amd64/${APPNAME} . 2>/dev/null
+
+windows-build:
+  @echo "windows build... 386"
+  @CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags "-s -X main.Build=${VERSION} -X main.Revision=${REV} -X main.Branch=${BRANCH} -X main.OSArch=windows/386" -v -o ./bin/windows-386/${APPNAME}.exe . 2>/dev/null
+  @echo "windows build... amd64"
+  @CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -X main.Build=${VERSION} -X main.Revision=${REV} -X main.Branch=${BRANCH} -X main.OSArch=windows/amd64" -v -o ./bin/windows-amd64/${APPNAME}.exe . 2>/dev/null
+
+lint:
+  @echo "GO LINT..."
+  @for pkg in $$(go list ./... |grep -v /vendor/) ; do \
+        golint -set_exit_status $$pkg ; \
+    done
+
+test: fmt generate lint vet
+  @echo "GO TEST..."
+  @go test $(TEST) $(TESTARGS) -v -timeout=30s -parallel=4 -bench=. -benchmem -cover
+
+cover:
+  @echo "GO TOOL COVER..."
+  @go tool cover 2>/dev/null; if [ $$? -eq 3 ]; then \
+    go get -u golang.org/x/tools/cmd/cover; \
+  fi
+  @go test $(TEST) -coverprofile=coverage.out
+  @go tool cover -html=coverage.out
+  @rm coverage.out
+
+generate:
+  @echo "GO GENERATE..."
+  @go generate $(go list ./... | grep -v /vendor/) ./
+
+# vet runs the Go source code static analysis tool `vet` to find
+# any common errors.
+vet:
+  @echo "GO VET..."
+  @govendor vet +l; if [ $$? -eq 1 ]; then \
+    echo ""; \
+    echo "Vet found suspicious constructs. Please check the reported constructs"; \
+    echo "and fix them if necessary before submitting the code for review."; \
+    exit 1; \
+  fi
+
+fmt:
+  @echo "GO FMT..."
+  @gofmt -w -s $(GOFMT_FILES)
+
+.PHONY: tools default
+? 2018 GitHub, Inc.
+Terms
+Privacy
+Security
+Status
+Help
+Contact GitHub
+API
+Training
+Shop
+Blog
+About
+Press h to open a hovercard with more details.