Last active
December 22, 2023 10:48
-
-
Save wwerner/05a8e627e8f3ba18300db745511d3bcb to your computer and use it in GitHub Desktop.
Enable heroku ps:exec in docker containers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
/bin/bash "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks everyone! @MrFishFinger's solution for alpine worked for me.