Created
March 8, 2018 20:49
-
-
Save IvanRibakov/fa69cc2fe87d133ff55405d384638f66 to your computer and use it in GitHub Desktop.
Packer template to illustrate issue with Docker and environment variables
This file contains 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
{ | |
"builders": [{ | |
"type": "docker", | |
"image": "centos:6", | |
"commit": true | |
}], | |
"provisioners": [ | |
{ | |
"type": "shell", | |
"inline": [ | |
"echo 'echo SUCCESS' > /root/test.sh", | |
"chmod +x /root/test.sh", | |
"echo 'export PATH=/root:$PATH' > /etc/profile.d/my_settings.sh", | |
"echo 'PATH=/root:$PATH' > /etc/environment", | |
"echo 'export PATH=/root:$PATH' > ~/.bashrc" | |
] | |
} | |
], | |
"post-processors": [ | |
[ | |
{ | |
"type": "docker-tag", | |
"repository": "test-image", | |
"tag": "1" | |
} | |
] | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment