title: How can I specify image name with docker-compose
body: <p>here is my docker-compose file</p>
  
  <p>and I built the image with <code>docker-compose build</code> command.</p>
  
  <p>How can I build the named images ? Because I got too many nonamed images</p>
  
  <h1>DOCKERFILE</h1>
  
  <pre><code>    FROM rails:onbuild
      # RUN apt-get update -qq &amp;&amp; apt-get install -y build-essential libpq-dev
      RUN apt-get update &amp;&amp; apt-get -y upgrade
      RUN apt-get -y -qq --force-yes install \
              build-essential \
              tree \
              ruby-dev \
              vim \
              vim-scripts \
              git \
              git-flow\
              curl \
              zsh \
              sudo
  
  
  # Install Zsh
  ################## BEGIN INSTALLATION ######################
  RUN git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh \
        &amp;&amp; cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc \
        &amp;&amp; chsh -s /bin/zsh
  </code></pre>
  
  <h1>docker-compose.yml</h1>
  
  <pre><code>db:
    image: postgres
    ports:
      - "5432"
  web:
    build: .
    command: bundle exec rails s -p 3001 -b '0.0.0.0'
    volumes:
      - .:/associated-press
    ports:
      - "3001:3001"
    links:
      - db
  </code></pre>
  
  <h1>Too many noname images</h1>
  
  <pre><code>associated_press git:(master) ✗ docker images                                                                                                                 (master⚡)
  REPOSITORY               TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
  &lt;none&gt;                   &lt;none&gt;              80c216ddb2a7        About an hour ago   1.093 GB
  &lt;none&gt;                   &lt;none&gt;              115a747757ec        About an hour ago   1.065 GB
  associatedpress_web      latest              cf136ac96689        About an hour ago   1.185 GB
  &lt;none&gt;                   &lt;none&gt;              c3e538c87495        17 hours ago        1.185 GB
  &lt;none&gt;                   &lt;none&gt;              c41d47cc6647        17 hours ago        1.185 GB
  &lt;none&gt;                   &lt;none&gt;              cd57f0d2165f        17 hours ago        1.185 GB
  &lt;none&gt;                   &lt;none&gt;              64544f8cb188        17 hours ago        1.185 GB
  &lt;none&gt;                   &lt;none&gt;              afd369c991d1        17 hours ago        1.185 GB
  &lt;none&gt;                   &lt;none&gt;              54113a645b47        19 hours ago        1.184 GB
  &lt;none&gt;                   &lt;none&gt;              d6986f926c4a        19 hours ago        1.184 GB
  &lt;none&gt;                   &lt;none&gt;              a22979b350af        19 hours ago        1.184 GB
  &lt;none&gt;                   &lt;none&gt;              5efecb684ecd        19 hours ago        1.064 GB
  &lt;none&gt;                   &lt;none&gt;              fca65cdaecfc        19 hours ago        1.184 GB
  &lt;none&gt;                   &lt;none&gt;              bf6ff095eedb        19 hours ago        1.064 GB
  &lt;none&gt;                   &lt;none&gt;              0697417f2fd1        19 hours ago        1.064 GB
  &lt;none&gt;                   &lt;none&gt;              9ed0d5b6fc70        19 hours ago        1.064 GB
  &lt;none&gt;                   &lt;none&gt;              f883183e0870        20 hours ago        1.161 GB
  &lt;none&gt;                   &lt;none&gt;              caa221a5f56e        20 hours ago        1.161 GB
  &lt;none&gt;                   &lt;none&gt;              88e6c706176f        20 hours ago        1.064 GB
  &lt;none&gt;                   &lt;none&gt;              3b48ab1152f4        20 hours ago        1.064 GB
  </code></pre>