Skip to content

Instantly share code, notes, and snippets.

@IvanRibakov
Created March 8, 2018 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IvanRibakov/fa69cc2fe87d133ff55405d384638f66 to your computer and use it in GitHub Desktop.
Save IvanRibakov/fa69cc2fe87d133ff55405d384638f66 to your computer and use it in GitHub Desktop.
Packer template to illustrate issue with Docker and environment variables
{
"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