does the spec for `build` follow the docs
Based of the docs it seems build and image can be used together to use image as the image tag when runningdocker build. The JSON spec doesn't allow both values together, but the cli does it actually exactly as the docs say.
{
...
"image": "my-devimage",
"build": {
"dockerfile": "Dockerfile",
}
}
squabbleup-holdup-mybisssh-sideways-feva-onit-clockinit-pipedown-kids-yehaw-fictional-fed>criminal-feelgood-sqabbleup
Hi @8de2fdb0, The documentation indicates that you can use either the Dockerfile specification or the image tag specification, but not both simultaneously. If you prefer to use a custom Dockerfile, you should use the build option. Alternatively, you can specify an image tag to directly use a particular image for your DevContainer.
The image option is used to specify a pre-built image for your development container.
The build option (with a Dockerfile) allows you to build a custom image for your container from source using the specified Dockerfile.
Ok I am just asking since https://github.com/devcontainers/cli and vscode will build an image using the tag from the image field and the Dockerfile speicified in build.dockerfile. So i was wondering why these implementations do exactly the same and the json spec show that these fields are not valid together.
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for license information.
ARG VARIANT="16-bullseye" FROM mcr.microsoft.com/devcontainers/typescript-node:1-${VARIANT}
RUN mkdir -p /workspaces && chown node:node /workspaces
ARG USERNAME=node USER $USERNAME
Save command line history
RUN echo "export HISTFILE=/home/$USERNAME/commandhistory/.bash_history" >> "/home/$USERNAME/.bashrc"
&& echo "export PROMPT_COMMAND='history -a'" >> "/home/$USERNAME/.bashrc"
&& mkdir -p /home/$USERNAME/commandhistory
&& touch /home/$USERNAME/commandhistory/.bash_history
&& chown -R $USERNAME /home/$USERNAME/commandhistory