mirror of
https://codeberg.org/scottslowe/learning-tools.git
synced 2026-03-11 09:04:37 +00:00
Update custom SSH configuration, add instructions
Update custom SSH configuration to use directory-specific known hosts file. Add preliminary set of instructions. Not quite ready to merge yet; CentOS Atomic Host on AWS seems to have an issue starting the Docker service. Signed-off-by: Scott Lowe <scott.lowe@scottlowe.org>
This commit is contained in:
parent
a5d3926f44
commit
3bbaef7f04
2 changed files with 40 additions and 0 deletions
38
centos-atomic/docker-cloudinit/README.md
Normal file
38
centos-atomic/docker-cloudinit/README.md
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# Instructions
|
||||
|
||||
1. Capture the VPC ID of your default VPC using this command:
|
||||
|
||||
VPC_ID=$(aws --output text ec2 describe-vpcs \
|
||||
--filters Name=isDefault,Values="true" \
|
||||
--query 'Vpcs[0].VpcId')
|
||||
|
||||
2. Capture the subnet ID of one of the subnets (the first, by default) in the default VPC using this command (step 1 must be completed first):
|
||||
|
||||
SN_ID=$(aws --output text ec2 describe-subnets \
|
||||
--filters Name=vpc-id,Values="$VPC_ID" \
|
||||
--query 'sort_by(Images,&AvailabilityZone)[0].SubnetId')
|
||||
|
||||
3. Capture the security group ID of a security group in the default VPC with the name "default" (it is assumed that this security group exists and allows SSH access to the instance; if this is not the case, you must fix this outside of this process):
|
||||
|
||||
SG_ID=$(aws --output text ec2 describe-security-groups \
|
||||
--filters Name=group-name,Values="default" \
|
||||
Name=vpc-id,Values="$VPC_ID" \
|
||||
--query 'SecurityGroups[0].GroupId')
|
||||
|
||||
4. Finally, capture the image ID of the latest version of the CentOS 7 Atomic Host AMI using this command:
|
||||
|
||||
IMAGE_ID=$(aws --output text ec2 describe-images \
|
||||
--owners 410186602215 --filter Name=name,Values="*CentOS Atomic*" \
|
||||
--query 'sort_by(Images,&CreationDate)[-1].ImageId')
|
||||
|
||||
5. Make sure you have an SSH key available to use with the instance and make note of the name of the SSH key.
|
||||
|
||||
6. Launch an AWS instance using this command:
|
||||
|
||||
aws ec2 run-instances --image-id $IMAGE_ID --instance-type t2.micro \
|
||||
--key-name keyname --user-data file://cloud-config.yml \
|
||||
--subnet-id $SN_ID --security-group-ids $SG_ID
|
||||
|
||||
7. Connect to the instance using SSH.
|
||||
|
||||
8. Verify that the Docker daemon is listening over a network socket (not the default configuration) by running `ss -lnt` and/or running `docker` commands against the network socket (via `-H tcp://127.0.0.1:2375`).
|
||||
|
|
@ -1,2 +1,4 @@
|
|||
UserKnownHostsFile ./known_hosts
|
||||
|
||||
Host *
|
||||
PubkeyAuthentication yes
|
||||
|
|
|
|||
Loading…
Reference in a new issue