Skip to content

nogayama/myapp1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

myapp1

  1. Write Dockerfile

    FROM scratch
    
    LABEL maintainer "Takahide Nogayama <[email protected]>"
    
    CMD ["/bin/bash"]
  2. Write .travis.yml

    language: bash
    
    services:
      - docker
    
    before_install:
      - docker image build --tag nogayama/test1:latest .
    
    script:
      - echo hello
  3. Go Travis CI Org with Github authentication

  4. Enable travis

    enable travis enabled_travis_on_github

  5. git add, commit, push

  6. gem install travis

  7. travis login --org

  8. edit .travis.yml by travis command

    $ travis encrypt DOCKER_USERNAME=nogayama --add env.global
    $ travis encrypt DOCKER_PASSWORD=PASSWORD --add env.global
  9. add docker login to Dockerfile

  10. add docker push. see pushing-a-docker-image-to-a-registry

    language: bash
    
    env:
      global:
      - secure: UrIeCrb ... gy4o=
      - secure: nbBGdzaz ... GGs4=
    
    services:
    - docker
    
    before_install:
    - docker image build --tag nogayama/myapp1:latest .
    - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
    - docker image push nogayama/myapp1:latest
    
    script:
    - echo hello
  11. The logs at Travis-CI https://travis-ci.org/nogayama/myapp1 was

    Worker information
    60.11s0.01s0.00s0.01s
    system_info
    7Build system information
    341
    3420.02s0.00s0.38s0.50s1.03s0.00s0.04s0.00s0.01s0.01s0.01s0.01s0.01s0.00s0.00s0.03s0.00s0.01s0.39s0.00s0.00s0.00s0.01s0.00s0.07s0.00s0.01s0.00s0.02s0.04s0.00s5.07s0.00s1.20s
    docker_mtu
    343docker stop/waiting
    resolvconf
    345resolvconf stop/waiting
    services
    3473.02s$ sudo service docker start
    git.checkout
    3490.62s$ git clone --depth=50 --branch=master https://github.com/[secure]/myapp1.git [secure]/myapp1
    353
    3540.02s
    355Setting environment variables from repository settings
    356$ export DOCKER_USERNAME=[secure]
    357
    358Setting environment variables from .travis.yml
    359$ export DOCKER_USERNAME=[secure]
    360$ export DOCKER_PASSWORD=[secure]
    361
    362$ bash -c 'echo $BASH_VERSION'
    3634.3.11(1)-release
    364
    before_install.1
    3650.51s$ docker image build --tag [secure]/myapp1:latest .
    before_install.2
    3790.56s$ echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
    before_install.3
    3812.39s$ docker image push [secure]/myapp1:latest
    3840.00s$ echo hello
    385hello
    386The command "echo hello" exited with 0.
    387
    388
    389Done. Your build exited with 0.
    
    
  12. confirm the image is pushed on Docker Hub.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published