-
Notifications
You must be signed in to change notification settings - Fork 159
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
Rework devcontainer to use proxygen server #1107
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
# Creates a docker image with a built copy of the site. Not repo-auth. | ||
# Useful as a scratch/testing area. | ||
FROM hhvm/hhvm:4.134-latest | ||
ARG DOCKER_BUILD_ENV=prod | ||
ENV TZ UTC | ||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
|
||
RUN rm -rf /var/www | ||
ADD . /var/www | ||
|
||
RUN touch /docker_build && cd /var/www && .deploy/init.sh | ||
RUN cd /var/www && touch /.docker_build && .deploy/init.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
if ! [ -e /.docker_build ]; then | ||
echo "This script should only be ran from a Dockerfile" | ||
exit 1 | ||
fi | ||
|
||
STAMP_FILE=/.hack_docs_system_init.stamp | ||
if [ -e "$STAMP_FILE" ]; then | ||
exit | ||
fi | ||
|
||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
echo "** Installing apt dependencies" | ||
# This is done by the dockerfile, but the intermediate issue can be cached, so do | ||
# it again here. | ||
apt-get clean | ||
apt-get update -y | ||
|
||
# Some environments (e.g. VSCode containers) will copy the exterior locale | ||
# settings, which can break things if the current locale isn't usable in the | ||
# container; using the `C` locale makes sure that the `locales` package | ||
# post-install succeeds. | ||
LC_ALL=C apt-get install -y ruby php-cli zip unzip locales | ||
|
||
echo "** Updating locales" | ||
locale-gen en_US.UTF-8 | ||
|
||
echo "** Installing composer" | ||
wget -qO /dev/stdout https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | ||
if [ ! -x /usr/local/bin/composer ]; then | ||
echo "Failed to install composer" | ||
exit 1 | ||
fi | ||
|
||
touch "$STAMP_FILE" |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM hhvm/hhvm-proxygen:4.134-latest | ||
|
||
ARG WORKSPACE | ||
|
||
RUN rm -rf /var/www; ln -s ${WORKSPACE} /var/www | ||
RUN ln -sf /var/www/hhvm.dev.ini /etc/hhvm/site.ini | ||
|
||
ADD .deploy/system-init.sh /var/tmp/system-init.sh | ||
RUN touch /.docker_build && /var/tmp/system-init.sh && rm /var/tmp/system-init.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "docs.hhvm.com", | ||
"runArgs": [ | ||
"--init" | ||
], | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"args": { | ||
"WORKSPACE": "${containerWorkspaceFolder}" | ||
}, | ||
"context": ".." | ||
}, | ||
"runArgs": [ | ||
"--env", "LC_ALL=C" | ||
], | ||
Atry marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"overrideCommand": false, | ||
|
||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"terminal.integrated.profiles.linux": { | ||
"bash": { | ||
"path": "/bin/bash", | ||
"args": [ | ||
"--login" | ||
] | ||
} | ||
}, | ||
"terminal.integrated.defaultProfile.linux": "bash" | ||
}, | ||
|
||
"extensions": [ "pranayagarwal.vscode-hack" ], | ||
"forwardPorts": [ 80 ], | ||
"postCreateCommand": ".deploy/init.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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.dockerenv
does not exist on buildkit but the cgroup approach should work.See https://stackoverflow.com/a/69860299/955091