Skip to content

Commit 1f06d29

Browse files
committed
Support post-startup script in libreoffice devcontainer
1 parent d1167cc commit 1f06d29

File tree

5 files changed

+28
-24
lines changed

5 files changed

+28
-24
lines changed

src/libreoffice/.devcontainer.json

+17-18
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,25 @@
44
"service": "app",
55
"shutdownAction": "none",
66
"workspaceFolder": "/workspace",
7-
// TODO: Enable this once Linux installation is resolved.
8-
// "postCreateCommand": [
9-
// "./startupscript/post-startup.sh",
10-
// "abc",
11-
// "/config",
12-
// "${templateOption:cloud}",
13-
// "${templateOption:login}"
14-
// ],
15-
// // re-mount bucket files on container start up
16-
// "postStartCommand": [
17-
// "./startupscript/remount-on-restart.sh",
18-
// "abc",
19-
// "/config",
20-
// "${templateOption:cloud}",
21-
// "${templateOption:login}"
22-
// ],
7+
"postCreateCommand": [
8+
"./startupscript/post-startup.sh",
9+
"abc",
10+
"/config",
11+
"gcp",
12+
"true"
13+
],
14+
// re-mount bucket files on container start up
15+
"postStartCommand": [
16+
"./startupscript/remount-on-restart.sh",
17+
"abc",
18+
"/config",
19+
"gcp",
20+
"true"
21+
],
2322
"remoteUser": "root",
2423
"features": {
25-
// TODO: Need to install Java for the CLI, but this feature does not support alpine linux.
26-
// "ghcr.io/devcontainers/features/java:1": {
24+
"./.devcontainer/features/workbench-cli": {}
25+
// "./.devcontainer/features/src/java": {
2726
// "version": "17"
2827
// }
2928
}
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../features/src

src/libreoffice/docker-compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "1.0"
1+
version: "2.4"
22
services:
33
app:
44
container_name: "application-server"

startupscript/install-java.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
# - USER_PRIMARY_GROUP: name of primary group app user belongs to
1414

1515
# Check if the user name is provided.
16-
ln -sf "$(which java)" "/usr/bin"
17-
chown --no-dereference "${USER_NAME}:${USER_PRIMARY_GROUP}" "/usr/bin/java"
16+
#ln -sf "$(which java)" "/usr/bin"
17+
#chown --no-dereference "${USER_NAME}:${USER_PRIMARY_GROUP}" "/usr/bin/java"
1818

startupscript/post-startup.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,13 @@ ${RUN_AS_LOGIN_USER} "ln -sf '${USER_WORKBENCH_CONFIG_DIR}' '${USER_WORKBENCH_LE
5555
exec >> "${POST_STARTUP_OUTPUT_FILE}"
5656
exec 2>&1
5757

58-
# The apt package index may not be clean when we run; resynchronize
59-
apt-get update
60-
apt install -y jq curl fuse tar wget
58+
# Test for apt-get being present.
59+
which apt-get && true
60+
if [[ $? -eq 0 ]]; then
61+
# The apt package index may not be clean when we run; resynchronize
62+
apt-get update
63+
apt install -y jq curl fuse tar wget
64+
fi
6165

6266
# Create the target directories for installing into the HOME directory
6367
${RUN_AS_LOGIN_USER} "mkdir -p '${USER_BASH_COMPLETION_DIR}'"

0 commit comments

Comments
 (0)