Skip to content

Commit

Permalink
build(dev-container): fix yarn not found error #1269
Browse files Browse the repository at this point in the history
Primary change:
------------------

The post-create-command.sh script will now run the
install-yarn script prior to calling the configure script.
This wil lensure that yarn is installed by the time the
configure script is invoked.

Secondary change(s):
------------------------

Applied automatic formatting to the Dockerfile and the
aforementioned post-create-commands script as well.

Fixes #1269

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed Aug 28, 2021
1 parent fcf26ed commit cc39408
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Note: You can use any Debian/Ubuntu based image you want.
# Note: You can use any Debian/Ubuntu based image you want.
FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu-20.04

# [Option] Install zsh
Expand All @@ -22,7 +22,7 @@ RUN apt-get update \
&& /bin/bash /tmp/library-scripts/docker-in-docker-debian.sh "${ENABLE_NONROOT_DOCKER}" "${USERNAME}" "${USE_MOBY}" \
# Clean up
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/

# Install software properties
RUN apt-get update \
&& apt-get install software-properties-common -y
Expand All @@ -38,8 +38,8 @@ RUN apt-get update \

VOLUME [ "/var/lib/docker" ]

# Setting the ENTRYPOINT to docker-init.sh will start up the Docker Engine
# inside the container "overrideCommand": false is set in devcontainer.json.
# Setting the ENTRYPOINT to docker-init.sh will start up the Docker Engine
# inside the container "overrideCommand": false is set in devcontainer.json.
# The script will also execute CMD if you need to alter startup behaviors.
ENTRYPOINT [ "/usr/local/share/docker-init.sh" ]
CMD [ "sleep", "infinity" ]
Expand Down
3 changes: 2 additions & 1 deletion .devcontainer/post-create-commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

set -e

whoami
whoami

NEW_PATH_ELEMENT="~/bin/"
echo "export PATH=\"$NEW_PATH_ELEMENT\":\${PATH}" >> ~/.bashrc

docker info

npm run install-yarn
npm run configure

0 comments on commit cc39408

Please sign in to comment.