Travis CI did not push image to docker

19 Views Asked by At

Hi am new to Docker and Travis, following on from a Udemy course we are wrote a travis file that build successfully but no images were pushed to docker hub.

The correct environment variables were added under the correct project.

Below is my travis.yml file

sudo: required
language: generic

services:
  - docker

before_install:
  - docker build -t muhammadhussain/react-test -f ./client/Dockerfile.dev ./client

script:
  - docker run -e CI=true muhammadhussain/react-test npm test

after_success:
  - docker build -t muhammadhussain/multi-client ./client
  - docker build -t muhammadhussain/multi-nginx ./nginx
  - docker build -t muhammadhussain/multi-server ./server
  - docker build -t muhammadhussain/multi-worker ./worker
  # Log in to the docker CLI
  - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_ID" --password-stdin
  # Take those images and push them to docker hub
  - docker push muhammadhussain/multi-client
  - docker push muhammadhussain/multi-nginx
  - docker push muhammadhussain/multi-server
  - docker push muhammadhussain/multi-worker

Image of the out put from Travis build. Everything is correct, checked docker no images of each container.

enter image description here

0

There are 0 best solutions below