Skip to content

Instantly share code, notes, and snippets.

@trung85
Forked from wwerner/Dockerfile
Created April 30, 2020 04:18
Show Gist options
  • Select an option

  • Save trung85/cf93664cfa846ab5124784a12d536a9d to your computer and use it in GitHub Desktop.

Select an option

Save trung85/cf93664cfa846ab5124784a12d536a9d to your computer and use it in GitHub Desktop.
Enable heroku ps:exec in docker containers
FROM openjdk:8-jdk-alpine
VOLUME /tmp
# see https://devcenter.heroku.com/articles/exec#enabling-docker-support
RUN apk add --no-cache curl bash openssh python
ADD src/main/docker/heroku-exec.sh /app/.profile.d/heroku-exec.sh
RUN chmod a+x /app/.profile.d/heroku-exec.sh
ADD src/main/docker/sh-wrapper.sh /bin/sh-wrapper.sh
RUN chmod a+x /bin/sh-wrapper.sh
RUN rm /bin/sh && ln -s /bin/sh-wrapper.sh /bin/sh
#!/usr/bin/env bash
# see https://devcenter.heroku.com/articles/exec#enabling-docker-support
[ -z "$SSH_CLIENT" ] && source <(curl --fail --retry 3 -sSL "$HEROKU_EXEC_URL")
#! /bin/bash
/bin/bash "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment