Skip to content

Instantly share code, notes, and snippets.

@greghuc
Forked from wwerner/Dockerfile
Created December 22, 2023 10:48
Show Gist options
  • Save greghuc/76be567a9d9566574642a28b0c402bd7 to your computer and use it in GitHub Desktop.
Save greghuc/76be567a9d9566574642a28b0c402bd7 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