Forked from sheldonh/docker-registry-mirror.service
          
        
    
          Last active
          August 29, 2015 14:07 
        
      - 
      
- 
        Save DoubleMalt/1613078cdaf8616ff63a to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | [Unit] | |
| Description=Docker registry mirror | |
| After=docker.service | |
| Requires=docker.service | |
| [Service] | |
| Environment=UNIT=docker-registry-mirror | |
| TimeoutStartSec=0 | |
| ExecStartPre=/usr/bin/docker pull registry | |
| ExecStartPre=-/usr/bin/docker run --name ${UNIT}-dvc -v /tmp/registry busybox true | |
| ExecStartPre=-/usr/bin/docker rm ${UNIT} | |
| ExecStart=/usr/bin/docker run --name ${UNIT} \ | |
| -e MIRROR_SOURCE=https://registry-1.docker.io \ | |
| -e MIRROR_SOURCE_INDEX=https://index.docker.io \ | |
| -e MIRROR_TAGS_CACHE_TTL=2592000 \ | |
| -p 5000:5000 \ | |
| --volumes-from ${UNIT}-dvc \ | |
| registry | |
| ExecStop=/usr/bin/docker stop ${UNIT} | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment