Open
Description
I am trying to run the container in an EC2 instance based on this packer.json file:
{
"variables": {
"region": "eu-west-2",
"instance_type": "t3.medium",
"ami_name": "docker-vnc-test-{{timestamp}}"
},
"builders": [
{
"type": "amazon-ebs",
"region": "{{user `region`}}",
"instance_type": "{{user `instance_type`}}",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*",
"root-device-type": "ebs"
},
"owners": ["099720109477"],
"most_recent": true
},
"iam_instance_profile": "admin",
"ssh_username": "ubuntu",
"ami_name": "{{user `ami_name`}}"
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"sudo apt-get update",
"sudo apt-get install -y unzip",
"curl \"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\" -o \"awscliv2.zip\"",
"unzip awscliv2.zip",
"sudo ./aws/install",
"sudo apt-get update",
"sudo apt-get install -y ca-certificates curl",
"sudo install -m 0755 -d /etc/apt/keyrings",
"sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc",
"sudo chmod a+r /etc/apt/keyrings/docker.asc",
"echo \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo \"$VERSION_CODENAME\") stable\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null",
"sudo apt-get update",
"sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin",
"sudo usermod -aG docker ubuntu",
"sudo systemctl enable docker",
"sudo chown $USER /var/run/docker.sock",
]
}
]
}
And then I start an instance based on that ami image by going into it and running:
docker run -it -p 5901:5901 -p 6901:6901 -e VNC_PASSWORDLESS=true consol/rocky-xfce-vnc
But when I go onto it, it just shows a blank blue screen. Works fine on my laptop. Is there anything I need to add to make it work on this ec2 instance? Is it because the ec2 instance doesn't have things installed that the docker container needs? Any help would be appreciated, thanks.
Metadata
Metadata
Assignees
Labels
No labels