hate these ads?, log in or register to hide them
Page 4 of 4 FirstFirst 1234
Results 61 to 63 of 63

Thread: Docker - Hype or Help?

  1. #61
    Frug's Avatar
    Join Date
    April 10, 2011
    Location
    Canada
    Posts
    13,070
    Quote Originally Posted by root View Post
    Ok, I made my own little docker repo. The hard part was making it work without SSL certificate.

    Now I run this script:
    Code:
    #!/bin/sh
    set -e
    
    mvn install
    docker build -t marsel:latest .
    docker tag -f marsel localhost:5000/marsel
    docker push localhost:5000/marsel
    I also found a maven plugin that does all of that. Maybe for a later time.

    On the serverside I have:
    docker-compose pull ;and docker-compose up -d --no-deps
    That will pull new images and only restart whatever got updated.
    I find tagging things as :latest causes issues. I don't know if some tools have a concept of only pulling 'latest' if it has a modified date newer than the last time they pulled it, but I know that when using Mesos, the various slaves did not do that. So 'latest' means random things unless you tell everyone to always re-pull an image.

    Also a bad habit to get into when building your image. Using FROM whatever:latest doesn't pin a version.

    I use a boilerplate Makefile something like this

    Code:
    IMAGE_NAME=localhost:5000/marsel
    IMAGE_TAG=0.1.0
    
    build:
        docker build -t $(IMAGE_NAME):$(IMAGE_TAG)
    
    push:
        docker push $(IMAGE_NAME):$(IMAGE_TAG)
    You could also do something fancier to use your git tag as the IMAGE_TAG so your repo is in sync with the image.

    Quote Originally Posted by Loire
    I'm too stupid to say anything that deserves being in your magnificent signature.

  2. #62
    Donor erichkknaar's Avatar
    Join Date
    April 10, 2011
    Posts
    8,968
    Quote Originally Posted by Frug View Post
    Quote Originally Posted by root View Post
    Ok, I made my own little docker repo. The hard part was making it work without SSL certificate.

    Now I run this script:
    Code:
    #!/bin/sh
    set -e
    
    mvn install
    docker build -t marsel:latest .
    docker tag -f marsel localhost:5000/marsel
    docker push localhost:5000/marsel
    I also found a maven plugin that does all of that. Maybe for a later time.

    On the serverside I have:
    docker-compose pull ;and docker-compose up -d --no-deps
    That will pull new images and only restart whatever got updated.
    I find tagging things as :latest causes issues. I don't know if some tools have a concept of only pulling 'latest' if it has a modified date newer than the last time they pulled it, but I know that when using Mesos, the various slaves did not do that. So 'latest' means random things unless you tell everyone to always re-pull an image.

    Also a bad habit to get into when building your image. Using FROM whatever:latest doesn't pin a version.

    I use a boilerplate Makefile something like this

    Code:
    IMAGE_NAME=localhost:5000/marsel
    IMAGE_TAG=0.1.0
    
    build:
        docker build -t $(IMAGE_NAME):$(IMAGE_TAG)
    
    push:
        docker push $(IMAGE_NAME):$(IMAGE_TAG)
    You could also do something fancier to use your git tag as the IMAGE_TAG so your repo is in sync with the image.
    Frug is 100% correct. You really shouldn't use latest. Our process used exact version numbers, and then somewhere in version control, a json file with:

    Code:
    {
      component: xxx
      version: 1.0.0
    }
    Your deployment scripts (or whatever) pick up a file with explicit versions contained within and deploy those versions exactly. When you rev up, you have one file that is a config of sorts, and that gets edited by whomever is in charge of such things in your production environment.
    meh

  3. #63
    root's Avatar
    Join Date
    April 26, 2011
    Location
    The Camel Empire
    Posts
    2,918
    Maybe I get the time to fiddle with the maven plugin. That might get the version number out of the pom file.

    But in the end, it's just a private little IRC bot that runs on my home NAS
    The Rapier is my love boat
    ~lowsec smallscale pvp 'n stuff~

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •