I tried to push my docker images from Travis CI to docker hub but its not appearing on my docker hub. All builds were successful
sudo: required
language: generic
services:
- docker
before_install:
- docker build -t nedstark/docker-tcwlmd -f restful/Dockerfile.dev .
# script:
# - docker run nedstark/docker-tcwlmd coverage run -m unittest discover restful/
after_success:
- docker build -t nedstark/server ./restful
- docker build -t nedstark/worker ./worker
- docker build -t nedstark/nginx ./nginx
#Log in to docker Cli
- echo "$DOCKER_PASSWORD" | docker login -u "DOCKER_ID" --password-stdin
#Take these images and push them to docker hub
- docker push nedstark/tcwl-server
- docker push nedstark/tcwl-worker
- docker push nedstark/tcwl-nginx
Create an Access-Token via the Docker Hub Settings --> Security
Add DOCKER_USERNAME
and DOCKER_PASSWORD
into your Travis-CI Build settings as environment variables. Make sure the DOCKER_PASSWORD
is the generated Access-Token from step 1
in the .travis.yml
add:
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" docker.io
This should be able to trigger a build and push the Docker Image to the Docker Hub.