mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-22 18:41:37 +00:00
Specific init.d script for GCP
Signed-off-by: David Gageot <david@gageot.net>
This commit is contained in:
parent
86c29efe87
commit
a54f2ae179
@ -57,6 +57,7 @@ RUN \
|
||||
rc-update add containerd default && \
|
||||
rc-update add aws default && \
|
||||
rc-update add azure default && \
|
||||
rc-update add gcp default && \
|
||||
true
|
||||
|
||||
CMD ["/mkinitrd.sh"]
|
||||
|
@ -49,6 +49,7 @@ moby.img: Dockerfile mkinitrd.sh init $(ETCFILES)
|
||||
-C packages/containerd etc -C ../.. \
|
||||
-C packages/aws etc -C ../.. \
|
||||
-C packages/azure etc -C ../.. \
|
||||
-C packages/gcp etc -C ../.. \
|
||||
| \
|
||||
docker build -q - ) && [ -n "$$BUILD" ] && echo "Built $$BUILD" && \
|
||||
echo $$BUILD > mobylinux.tag && \
|
||||
|
@ -86,6 +86,10 @@ start()
|
||||
cat /etc/docker/daemon.json | jq -e 'has("experimental")' > /dev/null || DOCKER_OPTS="${DOCKER_OPTS} --experimental"
|
||||
fi
|
||||
|
||||
# On GCP, send logs to Google Cloud Logging
|
||||
# Disabled because of https://github.com/docker/docker/issues/29344
|
||||
# [ $(mobyplatform) = "gcp" ] && DOCKER_OPTS="${DOCKER_OPTS} --log-driver=gcplogs"
|
||||
|
||||
# choose storage driver
|
||||
if ! $(cat /etc/docker/daemon.json | jq -e '."storage-driver"' > /dev/null)
|
||||
then
|
||||
|
29
alpine/packages/gcp/etc/init.d/gcp
Executable file
29
alpine/packages/gcp/etc/init.d/gcp
Executable file
@ -0,0 +1,29 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="Bootstrap procedure if running on Docker GCP edition"
|
||||
|
||||
depend()
|
||||
{
|
||||
need docker
|
||||
need net
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
[ "$(mobyplatform)" != "gcp" ] && exit 0
|
||||
ebegin "Running GCP-specific initialization"
|
||||
|
||||
ebegin "Run startup script"
|
||||
|
||||
temp_file=$(mktemp)
|
||||
curl -s http://metadata.google.internal/computeMetadata/v1/instance/attributes/startup-script -H "Metadata-Flavor: Google" > ${temp_file}
|
||||
[ -s "${temp_file}" ] && sh "${temp_file}"
|
||||
rm -f "${temp_file}"
|
||||
|
||||
eend 0
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
[ "$(mobyplatform)" != "gcp" ] && exit 0
|
||||
}
|
Loading…
Reference in New Issue
Block a user