Skip to content

Update ubuntu 18.04 entrypoint #399

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

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion release/preview/ubuntu18.04/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ LABEL maintainer="PowerShell Team <[email protected]>" \
org.label-schema.docker.cmd.test="docker run ${IMAGE_NAME} pwsh -c Invoke-Pester" \
org.label-schema.docker.cmd.help="docker run ${IMAGE_NAME} pwsh -c Get-Help"

ADD ./pwsh-entrypoint.sh /usr/local/bin/pwsh-entrypoint.sh

ENTRYPOINT [ "pwsh-entrypoint.sh" ]

# Use PowerShell as the default shell
# Use array to avoid Docker prepending /bin/sh -c
CMD [ "pwsh-preview" ]
9 changes: 9 additions & 0 deletions release/preview/ubuntu18.04/docker/pwsh-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set -e

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like this file is used?

Copy link
Member Author

@TravisEz13 TravisEz13 Mar 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes the script to quit if there is an error

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but I'm saying the entire shell file

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

# first arg is `pwsh` or similar
if ! { [ "$1" = 'pwsh' ] || [ "$1" = 'pwsh-preview' ] || [ "$1" = '/bin/bash' ] || [ "$1" = '/bin/sh' ] || [ "$1" = 'bash' ] || [ "$1" = 'sh' ]; }; then
set -- pwsh -nologo -l -c "$@"
fi

exec "$@"