-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from humanmade/altis-dev-tools-346/add-devcont…
…ainer-bootstrap-command Add template and bootstrap command for Codespaces dev container
- Loading branch information
Showing
4 changed files
with
372 additions
and
1 deletion.
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
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,23 @@ | ||
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/main/containers/php/.devcontainer/base.Dockerfile | ||
|
||
# [Choice] PHP version: 8, 8.0, 7, 7.4, 7.3 | ||
ARG PHP_VERSION="8.0" | ||
FROM mcr.microsoft.com/vscode/devcontainers/php:${PHP_VERSION} | ||
|
||
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 | ||
ARG NODE_VERSION="none" | ||
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi | ||
|
||
# [Optional] Uncomment this section to install additional OS packages. | ||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
# && apt-get -y install --no-install-recommends <your-package-list-here> | ||
|
||
# [Optional] Uncomment this line to install global node packages. | ||
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1 | ||
|
||
# Set up Docker | ||
COPY library-scripts/docker-in-docker-debian.sh /tmp/library-scripts/ | ||
RUN apt-get update && /bin/bash /tmp/library-scripts/docker-in-docker-debian.sh | ||
ENTRYPOINT ["/usr/local/share/docker-init.sh"] | ||
VOLUME [ "/var/lib/docker" ] | ||
CMD ["sleep", "infinity"] |
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,47 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.192.0/containers/php | ||
{ | ||
"name": "PHP", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"args": { | ||
"PHP_VERSION": "8", | ||
"NODE_VERSION": "lts/*" | ||
} | ||
}, | ||
"mounts": [ | ||
"source=dind-var-lib-docker,target=/var/lib/docker,type=volume" | ||
], | ||
"runArgs": [ | ||
"--init", | ||
"--privileged" | ||
], | ||
"overrideCommand": false, | ||
|
||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"php.validate.executablePath": "/usr/local/bin/php" | ||
}, | ||
|
||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"felixfbecker.php-debug", | ||
"bmewburn.vscode-intelephense-client", | ||
"mrmlnc.vscode-apache" | ||
], | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [ | ||
80, | ||
8080, | ||
], | ||
"otherPortsAttributes": { | ||
"onAutoForward": "ignore" | ||
}, | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html" | ||
|
||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "vscode" | ||
} |
Oops, something went wrong.