Update to 0.134.0 verison of definition
This commit is contained in:
@@ -1,54 +1,15 @@
|
|||||||
# Update the VARIANT arg in devcontainer.json to pick a PHP version
|
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.134.0/containers/php/.devcontainer/base.Dockerfile
|
||||||
ARG VARIANT=7
|
ARG VARIANT="7"
|
||||||
FROM php:${VARIANT}-cli
|
FROM mcr.microsoft.com/vscode/devcontainers/php:0-${VARIANT}
|
||||||
|
|
||||||
# This Dockerfile adds a non-root user with sudo access. Update the “remoteUser” property in
|
# [Optional] Install a version of Node.js using nvm for front end dev
|
||||||
# devcontainer.json to use it. More info: https://aka.ms/vscode-remote/containers/non-root-user.
|
ARG INSTALL_NODE="true"
|
||||||
ARG USERNAME=vscode
|
|
||||||
ARG USER_UID=1000
|
|
||||||
ARG USER_GID=$USER_UID
|
|
||||||
|
|
||||||
# Options for common setup script - SHA generated on release
|
|
||||||
ARG INSTALL_ZSH="true"
|
|
||||||
ARG UPGRADE_PACKAGES="false"
|
|
||||||
ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/common-debian.sh"
|
|
||||||
ARG COMMON_SCRIPT_SHA="dev-mode"
|
|
||||||
|
|
||||||
# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.
|
|
||||||
RUN apt-get update \
|
|
||||||
&& export DEBIAN_FRONTEND=noninteractive \
|
|
||||||
&& apt-get -y install --no-install-recommends curl ca-certificates 2>&1 \
|
|
||||||
&& curl -sSL ${COMMON_SCRIPT_SOURCE} -o /tmp/common-setup.sh \
|
|
||||||
&& ([ "${COMMON_SCRIPT_SHA}" = "dev-mode" ] || (echo "${COMMON_SCRIPT_SHA} */tmp/common-setup.sh" | sha256sum -c -)) \
|
|
||||||
&& /bin/bash /tmp/common-setup.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \
|
|
||||||
# Clean up
|
|
||||||
&& apt-get autoremove -y \
|
|
||||||
&& apt-get clean -y \
|
|
||||||
&& rm -rf /var/lib/apt/lists/* /tmp/common-setup.sh
|
|
||||||
|
|
||||||
# Install xdebug
|
|
||||||
RUN yes | pecl install xdebug \
|
|
||||||
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
|
|
||||||
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
|
|
||||||
&& echo "xdebug.remote_autostart=on" >> /usr/local/etc/php/conf.d/xdebug.ini
|
|
||||||
|
|
||||||
# [Optional] Install Node.js for use with web applications - update the INSTALL_NODE arg in devcontainer.json to enable.
|
|
||||||
ARG INSTALL_NODE="false"
|
|
||||||
ARG NODE_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/node-debian.sh"
|
|
||||||
ARG NODE_SCRIPT_SHA="dev-mode"
|
|
||||||
ARG NODE_VERSION="lts/*"
|
ARG NODE_VERSION="lts/*"
|
||||||
ENV NVM_DIR=/usr/local/share/nvm
|
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
|
||||||
ENV NVM_SYMLINK_CURRENT=true
|
|
||||||
ENV PATH=${NVM_DIR}/current/bin:${PATH}
|
|
||||||
RUN if [ "$INSTALL_NODE" = "true" ]; then \
|
|
||||||
curl -sSL ${NODE_SCRIPT_SOURCE} -o /tmp/node-setup.sh \
|
|
||||||
&& ([ "${NODE_SCRIPT_SHA}" = "dev-mode" ] || (echo "${COMMON_SCRIPT_SHA} */tmp/node-setup.sh" | sha256sum -c -)) \
|
|
||||||
&& /bin/bash /tmp/node-setup.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}" \
|
|
||||||
&& rm -rf /var/lib/apt/lists/* /tmp/node-setup.sh; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# [Optional] Uncomment this section to install additional packages.
|
# [Optional] Uncomment this section to install additional OS packages.
|
||||||
# RUN apt-get update \
|
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||||
# && export DEBIAN_FRONTEND=noninteractive \
|
|
||||||
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
# && 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
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
|
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
|
||||||
|
// https://github.com/microsoft/vscode-dev-containers/tree/v0.134.0/containers/php
|
||||||
{
|
{
|
||||||
"name": "PHP Sample",
|
"name": "PHP",
|
||||||
"build": {
|
"build": {
|
||||||
"dockerfile": "Dockerfile",
|
"dockerfile": "Dockerfile",
|
||||||
"args": {
|
"args": {
|
||||||
// Update VARIANT to pick a PHP version
|
// Update VARIANT to pick a PHP version: 7, 7.4, 7.3
|
||||||
"VARIANT": "7",
|
"VARIANT": "7",
|
||||||
"INSTALL_NODE": "true",
|
"INSTALL_NODE": "false",
|
||||||
"NODE_VERSION": "lts/*"
|
"NODE_VERSION": "lts/*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -27,6 +29,6 @@
|
|||||||
// Use 'postCreateCommand' to run commands after the container is created.
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
// "postCreateCommand": "php -v",
|
// "postCreateCommand": "php -v",
|
||||||
|
|
||||||
// Comment out to use the root user instead. See https://aka.ms/vscode-remote/containers/non-root.
|
// Comment out to connect as root instead.
|
||||||
"remoteUser": "vscode"
|
"remoteUser": "vscode"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user