Skip to content

Commit

Permalink
alapenna: review post-start.sh logic
Browse files Browse the repository at this point in the history
  • Loading branch information
deviantony committed Dec 5, 2024
1 parent a5be42a commit bdbb3b6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
# 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
6 changes: 1 addition & 5 deletions entrypoint.sh → post-start.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
2 changes: 1 addition & 1 deletion user-toolkits/alapenna/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ RUN apt install -y protobuf-compiler
RUN printf '[url "ssh://[email protected]/"]\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
3 changes: 2 additions & 1 deletion user-toolkits/alapenna/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand All @@ -24,4 +25,4 @@
}
},
"remoteUser": "root"
}
}

0 comments on commit bdbb3b6

Please sign in to comment.