Skip to content

Commit 6dba018

Browse files
authored
local run_docker fixes. (google#1939)
- Fix metadata server to not include stderr in access token command. - Quote COMMAND_OVERRIDE in run_docker.bash - Use sudo for docker in run_docker.bash
1 parent 1f375a5 commit 6dba018

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

local/emulators/metadata.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func refreshTokenIfNeeded() error {
110110
tokenLock.RUnlock()
111111

112112
cmd := exec.Command("gcloud", "auth", "application-default", "print-access-token")
113-
output, err := cmd.CombinedOutput()
113+
output, err := cmd.Output()
114114
if err != nil {
115115
return err
116116
}

local/run_docker.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ else
4040
CONFIG_DIR_OVERRIDE="/config"
4141
fi
4242

43-
docker run -e COMMAND_OVERRIDE=$COMMAND_OVERRIDE -e SETUP_NFS= -e HOST_UID=$UID \
43+
sudo docker run -e COMMAND_OVERRIDE="$COMMAND_OVERRIDE" -e SETUP_NFS= -e HOST_UID=$UID \
4444
-e LOCAL_METADATA_SERVER=$docker_ip -e LOCAL_METADATA_PORT=8080 \
4545
-e USE_LOCAL_DIR_FOR_NFS=1 $MOUNT_ARGS \
4646
-e LOCAL_SRC=$LOCAL_SRC \

0 commit comments

Comments
 (0)