diff --git a/Dockerfile b/Dockerfile index 738e183..604e300 100644 --- a/Dockerfile +++ b/Dockerfile @@ -86,7 +86,6 @@ ENV GOROOT="/usr/local/go" \ GOPATH="/root/go" \ PATH="/usr/local/go/bin:/root/go/bin:/root/.nvm/versions/node/v${NODE_VERSION}/bin:${PATH}" -# Set a custom entrypoint -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file +# Inject a post-start.sh script that can be used via postStartCommand +COPY post-start.sh /post-start.sh +RUN chmod +x /post-start.sh \ No newline at end of file diff --git a/entrypoint.sh b/post-start.sh similarity index 55% rename from entrypoint.sh rename to post-start.sh index 60e161c..a6382e4 100644 --- a/entrypoint.sh +++ b/post-start.sh @@ -1,11 +1,7 @@ #!/bin/bash -# This is an entrypoint script that is used execute some actions -# when the container is started. +# This script can trigger actions post dev container startup. # We clean-up the tmp folder as part of the startup because it can # be flooded very fast with files and folders related to vscode, devextension, yarn, gobuilds etc... rm -rf /tmp/* - -# Execute the default command from the base image -exec "$@" \ No newline at end of file diff --git a/user-toolkits/alapenna/Dockerfile b/user-toolkits/alapenna/Dockerfile index b57bed3..404156c 100644 --- a/user-toolkits/alapenna/Dockerfile +++ b/user-toolkits/alapenna/Dockerfile @@ -41,4 +41,4 @@ RUN apt install -y protobuf-compiler RUN printf '[url "ssh://git@github.com/"]\n\tinsteadOf = https://github.com/\n' > /root/.gitconfig # Update .zshrc -RUN echo 'export PATH="$PATH:/root/.local/bin"' >> /root/.zshrc +RUN echo 'export PATH="$PATH:/root/.local/bin"' >> /root/.zshrc \ No newline at end of file diff --git a/user-toolkits/alapenna/devcontainer.json b/user-toolkits/alapenna/devcontainer.json index ca4f817..11c009f 100644 --- a/user-toolkits/alapenna/devcontainer.json +++ b/user-toolkits/alapenna/devcontainer.json @@ -1,6 +1,7 @@ { "name": "portainer-dev-toolkit", "image": "portainer-dev-toolkit:alapenna", + "postStartCommand": "/post-start.sh", "forwardPorts": [6443, 8999, 9000], "appPort": ["8000:8000", "9443:9443"], "mounts": [ @@ -24,4 +25,4 @@ } }, "remoteUser": "root" -} +} \ No newline at end of file