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:
parent
a5ff5016c9
commit
2b4a1ef17d
19
.travis.yml
19
.travis.yml
@ -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
|
@ -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
|
8
Makefile
8
Makefile
@ -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 ./...
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user