Coyle/docker fix (#109)

* port changes

* Merge remote-tracking branch 'upstream/master'

* Merge remote-tracking branch 'upstream/master'

* Merge remote-tracking branch 'upstream/master'

* Merge remote-tracking branch 'upstream/master'

* Merge remote-tracking branch 'upstream/master'

* Merge branch 'master' of https://github.com/storj/storj

* fixing tag name

* no idea

* testing

* changes

* testing on travis

* testing

* changes to travis build

* new approach

* Merge branch 'master' into coyle/docker-fix
This commit is contained in:
Dennis Coyle 2018-06-22 16:17:37 -04:00 committed by GitHub
parent a5ff5016c9
commit 2b4a1ef17d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 82 deletions

View File

@ -1,30 +1,13 @@
# make use of vm's
sudo: 'required'
# have the docker service set up (we'll
# update it later)
services:
- 'docker'
language: go
go:
- 1.10.x
before_install:
- './.travis/main.sh'
- echo -e "machine api.github.com login coyle password $GITHUB_TOKEN" >> ~/.netrc
- source scripts/travis-deps.sh
install:
- make build-dev-deps
script:
- make test
- make images
after_success:
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin ;
make push-images ;
fi
- make test

View File

@ -1,61 +0,0 @@
#!/bin/bash
# Set an option to exit immediately if any error appears
set -o errexit
# Main function that describes the behavior of the
# script.
# By making it a function we can place our methods
# below and have the main execution described in a
# concise way via function invocations.
main() {
setup_dependencies
update_docker_configuration
echo "SUCCESS:
Done! Finished setting up Travis machine.
"
}
# Prepare the dependencies that the machine need.
# Here I'm just updating the apt references and then
# installing both python and python-pip. This allows
# us to make use of `pip` to fetch the latest `docker-compose`
# later.
# We also upgrade `docker-ce` so that we can get the
# latest docker version which allows us to perform
# image squashing as well as multi-stage builds.
setup_dependencies() {
echo "INFO:
Setting up dependencies.
"
sudo apt update -y
sudo apt install realpath python python-pip -y
sudo apt install --only-upgrade docker-ce -y
sudo pip install docker-compose || true
docker info
docker-compose --version
}
# Tweak the daemon configuration so that we
# can make use of experimental features (like image
# squashing) as well as have a bigger amount of
# concurrent downloads and uploads.
update_docker_configuration() {
echo "INFO:
Updating docker configuration
"
echo '{
"experimental": true,
"storage-driver": "overlay2",
"max-concurrent-downloads": 50,
"max-concurrent-uploads": 50
}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
}
main

View File

@ -74,9 +74,13 @@ clean-local:
docker network rm test-net || true
images:
docker build --build-arg VERSION=${GO_VERSION} -t storjlabs/overlay:${TAG}-${GO_VERSION} .
docker build --build-arg VERSION=${GO_VERSION} -t storjlabs/overlay:${TAG}-${GO_VERSION} -f cmd/overlay/Dockerfile .
docker tag storjlabs/overlay:${TAG}-${GO_VERSION} overlay:latest
push-images:
docker push storjlabs/overlay:${TAG}-${GO_VERSION}
docker push storjlabs/overlay:latest
docker push storjlabs/overlay:latest
install-deps:
go get -u -v golang.org/x/vgo
cd vgo install ./...

View File

@ -3,7 +3,7 @@ ARG VERSION
# build
FROM golang:${VERSION} AS build-env
COPY . /go/src/storj.io/storj
RUN go get -u -v golang.org/x/vgo
RUN go get -u golang.org/x/vgo
RUN cd /go/src/storj.io/storj && vgo install ./...
RUN cd /go/src/storj.io/storj/cmd/overlay && vgo build -o overlay