Update image to install docker and fix permissions

PiperOrigin-RevId: 266467361
This commit is contained in:
Adin Scannell
2019-08-30 15:27:47 -07:00
committed by gVisor bot
parent 888e87909e
commit 3ec0b64d8c
3 changed files with 43 additions and 1 deletions
+35
View File
@@ -0,0 +1,35 @@
#!/bin/bash
# Copyright 2019 The gVisor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Add dependencies.
apt-get update && apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
# Install the key.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
# Add the repository.
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# Install docker.
apt-get update && apt-get install -y docker-ce docker-ce-cli containerd.io
+7 -1
View File
@@ -23,7 +23,7 @@ declare -r ssh_public_keys=(
)
# Install dependencies.
apt-get update && apt-get install -y rsync coreutils python-psutil
apt-get update && apt-get install -y rsync coreutils python-psutil qemu-kvm
# We need a kbuilder user.
if useradd -c "kbuilder user" -m -s /bin/bash kbuilder; then
@@ -39,6 +39,12 @@ cat > /etc/sudoers.d/kokoro <<EOF
kbuilder ALL=(ALL) NOPASSWD:ALL
EOF
# Ensure we can run Docker without sudo.
usermod -aG docker kbuilder
# Ensure that we can access kvm.
usermod -aG kvm kbuilder
# Ensure that /tmpfs exists and is writable by kokoro.
#
# Note that kokoro will typically attach a second disk (sdb) to the instance
+1
View File
@@ -0,0 +1 @@
../ubuntu1604/25_docker.sh