Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question: (basic) best practice for using herokuish to create a runnable image #62

Closed
tony-kerz opened this issue Aug 11, 2015 · 8 comments

Comments

@tony-kerz
Copy link

hi,

apologies in advance for beginner question (feel free to redirect me to more appropriate forum).

i have been using tutum/buildstep to build a runnable image like so as part of a home-grown build pipeline using jenkins, git and a docker runtime platform.

i recently wanted to use an iojs runtime in a node app, and it turns out that requires a more recent node buildpack than the one baked into the version of tutum/buildstep on dockerhub.

trying to gain some background context, i did some research and came across this thread about preferring herokuish over buildstep.

along those lines, i would like to use herokuish directly without tutum or progrium buildsteps, but i'm not clear on exactly how to accomplish that.

for example would i use:

  1. some form of docker run gliderlabs/herokuish at the command line, or
  2. FROM gliderlabs/herokuish with some other commands in a Dockerfile

any guidance or examples would be appreciated

best,
tony.

@progrium
Copy link
Contributor

You'd use docker run. I suppose the readme doesn't explain this well? I'll need to write better docs for end users.

@tony-kerz
Copy link
Author

i toyed with docker run, but it wasn't clear to me how to get to a built docker image that way.

i was able to get the desired effect with a Dockerfile that looks like this:

FROM gliderlabs/herokuish

RUN mkdir -p /app
ADD . /app
RUN /build

ENTRYPOINT ["/exec", "node", "/app/my-app.js"]

and running:

docker build -t me/my-image .
docker run --rm me/my-image

(in my case, my app is just a node command-line app)

does that seem like a reasonable approach?

@progrium
Copy link
Contributor

Yeah that works alright, too.

On Wed, Aug 12, 2015 at 8:58 AM, tony kerz notifications@github.com wrote:

i toyed with docker run, but it wasn't clear to me how to get to a built
docker image that way.

i was able to get the desired effect with a Dockerfile that looks like
this:

FROM gliderlabs/herokuish

RUN mkdir -p /app
ADD . /app
RUN /build

ENTRYPOINT ["/exec", "node", "/app/my-app.js"]

and running:

docker build -t me/my-image .
docker run --rm me/my-image

(in my case, my app is just a node command-line app)

does that seem like a reasonable approach?


Reply to this email directly or view it on GitHub
#62 (comment)
.

Jeff Lindsay
http://progrium.com

@msabramo
Copy link

What would the docker run approach look like?

@msabramo
Copy link

docker run --rm -v $(pwd):/tmp/app gliderlabs/herokuish /bin/herokuish buildpack build foobar

seems to execute without any errors, but where is the new image?

@Haybu
Copy link

Haybu commented Jan 30, 2017

docker run --rm -v $(pwd):/tmp/app gliderlabs/herokuish /bin/herokuish buildpack build foobar

works all good, where is the built image gets saved ?

@josegonzalez
Copy link
Member

If you do not docker commit the change, its simply in the ephemeral container that is running. You can either specify a name --name or use docker commit to save the image id.

@joshmanders
Copy link
Contributor

The built container is the one you run, you added the --rm flag to the run command, which means after the container exited, to remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants