Skip to content

Commit bdbb3b6

Browse files
committed
alapenna: review post-start.sh logic
1 parent a5be42a commit bdbb3b6

4 files changed

Lines changed: 7 additions & 11 deletions

File tree

Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ ENV GOROOT="/usr/local/go" \
8686
GOPATH="/root/go" \
8787
PATH="/usr/local/go/bin:/root/go/bin:/root/.nvm/versions/node/v${NODE_VERSION}/bin:${PATH}"
8888

89-
# Set a custom entrypoint
90-
COPY entrypoint.sh /entrypoint.sh
91-
RUN chmod +x /entrypoint.sh
92-
ENTRYPOINT ["/entrypoint.sh"]
89+
# Inject a post-start.sh script that can be used via postStartCommand
90+
COPY post-start.sh /post-start.sh
91+
RUN chmod +x /post-start.sh
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
#!/bin/bash
22

3-
# This is an entrypoint script that is used execute some actions
4-
# when the container is started.
3+
# This script can trigger actions post dev container startup.
54

65
# We clean-up the tmp folder as part of the startup because it can
76
# be flooded very fast with files and folders related to vscode, devextension, yarn, gobuilds etc...
87
rm -rf /tmp/*
9-
10-
# Execute the default command from the base image
11-
exec "$@"

user-toolkits/alapenna/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ RUN apt install -y protobuf-compiler
4141
RUN printf '[url "ssh://git@github.com/"]\n\tinsteadOf = https://github.com/\n' > /root/.gitconfig
4242

4343
# Update .zshrc
44-
RUN echo 'export PATH="$PATH:/root/.local/bin"' >> /root/.zshrc
44+
RUN echo 'export PATH="$PATH:/root/.local/bin"' >> /root/.zshrc

user-toolkits/alapenna/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "portainer-dev-toolkit",
33
"image": "portainer-dev-toolkit:alapenna",
4+
"postStartCommand": "/post-start.sh",
45
"forwardPorts": [6443, 8999, 9000],
56
"appPort": ["8000:8000", "9443:9443"],
67
"mounts": [
@@ -24,4 +25,4 @@
2425
}
2526
},
2627
"remoteUser": "root"
27-
}
28+
}

0 commit comments

Comments
 (0)