From 7fe6719b90aef5d0e89a062f3fa353a72d10b789 Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Thu, 20 Jun 2024 11:32:09 -0400 Subject: [PATCH] Fix mounting instancestore --- hello-cdk/lib/hello-cdk-stack.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hello-cdk/lib/hello-cdk-stack.ts b/hello-cdk/lib/hello-cdk-stack.ts index ef6fa67..7f88b22 100644 --- a/hello-cdk/lib/hello-cdk-stack.ts +++ b/hello-cdk/lib/hello-cdk-stack.ts @@ -9,12 +9,13 @@ export class HelloCdkStack extends cdk.Stack { const userData = ec2.UserData.forLinux(); userData.addCommands( + "#!/bin/bash", "volume_name=`lsblk -x SIZE -o NAME | tail -n 1`", "mkfs -t ext4 /dev/$volume_name", "mkdir /docker", "mount /dev/$volume_name /docker", "echo '{\"data-root\": \"/docker\"}' > /etc/docker/daemon.json", - "systemctl restart docker --no-block" + "systemctl restart docker" ); const multipartUserData = new ec2.MultipartUserData();