0

I am very new to Docker. I need add packer to docker image. So I used following Dockerfile to solve my problem.

FROM jenkinsci/jnlp-slave

USER root

RUN apt-get update && apt-get install -y unzip 
RUN wget https://releases.hashicorp.com/packer/1.3.2/packer_1.3.2_linux_amd64.zip
RUN unzip packer_1.3.2_linux_amd64.zip -d packer
RUN mv packer /usr/local/
RUN export PATH=$PATH:/usr/local/packer/

ENTRYPOINT ["packer"]

I can build this successfully. But when I execute this I got following error.

starting container process caused "exec: \"packer\": executable file not found in $PATH": unknown.

My aim is to create slave for jenkins using docker. That slave need to include packer. Thank you

dhananjana
  • 53
  • 1
  • 12
  • 1
    Possible duplicate of [In a Dockerfile, How to update PATH environment variable?](https://stackoverflow.com/questions/27093612/in-a-dockerfile-how-to-update-path-environment-variable) – David Maze Nov 02 '18 at 10:47
  • 1
    `RUN export ...` doesn't do anything; each `RUN` command starts a new shell with a new default environment. Since the Hashicorp tools are distributed as single binaries, you could also just put the `packer` binary itself into `/usr/local/bin` or another directory that's already on `$PATH`. – David Maze Nov 02 '18 at 10:48
  • Thank you Its works I did not think that error was in this path thank you for your valuable help – dhananjana Nov 02 '18 at 10:54

0 Answers0