Warning: notes were written for unix/linux.
### Instructions for contributing the second+ time:
$ ./gradlew build
$ docker build --build-arg DEPENDENCY=build/dependency -t springboot-gradle-docker-aws .
$ docker run -p 8080:8080 springboot-gradle-docker-aws:latest
$ docker tag springboot-gradle-docker-aws:latest 761280559302.dkr.ecr.us-east-2.amazonaws.com/springboot-gradle-docker-aws:latest
$ aws ecr get-login-password --region us-east-2 | docker login --username AWS --password-stdin 761280559302.dkr.ecr.us-east-2.amazonaws.com/springboot-gradle-docker-aws
$ docker push 761280559302.dkr.ecr.us-east-2.amazonaws.com/springboot-gradle-docker-aws
$ ssh -i ~/codebase/MyKeyPair.pem ec2-user@ec2-3-22-239-41.us-east-2.compute.amazonaws.com
$ aws ecr get-login-password --region us-east-2 | sudo docker login --username AWS --password-stdin 761280559302.dkr.ecr.us-east-2.amazonaws.com/springboot-gradle-docker-aws
$ sudo docker pull 761280559302.dkr.ecr.us-east-2.amazonaws.com/springboot-gradle-docker-aws:latest
$ sudo docker stop springboot-gradle-docker-aws && sudo docker rm springboot-gradle-docker-aws
$ sudo docker run -d --name springboot-gradle-docker-aws -p 80:80 761280559302.dkr.ecr.us-east-2.amazonaws.com/springboot-gradle-docker-aws:latest >> output.txt
### Instructions for the first time you contribute:
$ git clone https://github.com/clever-wildcard/springboot-gradle-docker-aws.git
$ git checkout -b relevantly-named-branch
Make exciting, beautiful changes.
$ ./gradlew build
$ docker build --build-arg DEPENDENCY=build/dependency -t springboot-gradle-docker-aws .
$ docker run -p 8080:8080 springboot-gradle-docker-aws:latest
If your changes should be visible in a browser, then open one up and go to localhost:8080/whatever-endpoint-was-impacted.
CHECKING REST BASED CHANGES
Right, so let's say you've made the changes you want to make.
$ docker tag springboot-gradle-docker-aws:latest 761280559302.dkr.ecr.us-east-2.amazonaws.com/springboot-gradle-docker-aws:latest
Install aws cli v2: https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html
Let's say you're not the root user of this aws employee. Then the next thing you'd want to do is ask the root user on the employee (me, in this case) to be added to the IAM Users groups 'administrators'. Then the root user would get back to you with the console sign in link and/or an aws_access_key_id/aws_secret_access_key.
$ cd ~/.aws && ls
`$ touch config && open config` if config doesn't exist. Otherwise, `$ open config`
[default]
region = us-east-2
output = json
(Again, these instructions are specific to this project. If you're using your own project, be careful about the region, both here, in any terminal commands, files to be used in terminal commands, and in the aws web console.)
Save and close.
`$ touch credentials && open credentials` if credentials doesn't exist. Otherwise, `$ open credentials`
[default]
aws_access_key_id = whatever access key id you were given or downloaded or whatever
aws_secret_access_key = whatever secret access key you were given or downloaded or whatever
Save and close.
$ aws ecr get-login-password --region us-east-2 | docker login --username AWS --password-stdin 761280559302.dkr.ecr.us-east-2.amazonaws.com/springboot-gradle-docker-aws
$ docker push 761280559302.dkr.ecr.us-east-2.amazonaws.com/springboot-gradle-docker-aws
Get the key pair from the root user.
(Again, these instructions are specific to this project. There are instructions in the section below for generating your own key pair if you're making your own project.)
$ ssh -i ~/codebase/MyKeyPair.pem ec2-user@ec2-3-22-239-41.us-east-2.compute.amazonaws.com
Now you should be in the EC2 instance (which is basically just a virtual machine that, in this case, runs on an amazon flavor of linux).
EC2 instance `$ aws ecr get-login-password --region us-east-2 | sudo docker login --username AWS --password-stdin 761280559302.dkr.ecr.us-east-2.amazonaws.com/springboot-gradle-docker-aws`
NOTE! THAT COMMAND IS NOT IDENTICAL TO THE ONE YOU RAN ON YOUR LOCAL MACHINE!
EC2 instance `$ sudo docker pull 761280559302.dkr.ecr.us-east-2.amazonaws.com/springboot-gradle-docker-aws:latest -d --name springboot-gradle-docker-aws`
EC2 instance `$ sudo docker stop springboot-gradle-docker-aws`
EC2 instance `sudo docker run -d -p 80:80 761280559302.dkr.ecr.us-east-2.amazonaws.com/springboot-gradle-docker-aws:latest --name springboot-gradle-docker-aws`
Check things work again. This time instead of going to localhost:80 to change, you'll start at annaofalltrades.com.
$ git add . && git commit -m "relevant comment" && git push
Done :).
### To Recreate:
Make a new github project.
Though you don't have to, I recommend initializing it with a .gitignore file, a License file and a README.md file. If you like open source things I recommend Mozilla's license. If you like going with things that are commonly used, you might try the MIT or GnU ones.THe MIT and GnU ones. (Let me know if you're wondering what github is / why we need it / why initialize the project with those files and I'll update this README.md accordingly :)).
Your project page has a green button `Code`. Click that, then click the clipboard icon to copy the HTTPS link.
Right, so to keep things easy to read, I'm going to continue to use the info for this project in the rest of this readme, but be sure to use your own project name / git clone links / etc.
On your local machine open up a command line interface (CLI). (Local machine is just jargon - in this case for your regular old laptop / computer. To get to the CLI appropriate for your operating system: on a mac, search for terminal; on a windows, search for command prompt / powershell.) Oh, also, from here on out, if you see anything that starts with '$', that means type out the rest of that line on the terminal. For example, if you see `$ cd ~` in your terminal you'll just type `cd ~`. (I know, I called it a CLI earlier, but it'll be easier to write and read if we just pick one and refer to it hereafter.)
Make a new springboot project.
Download a new springboot project instructions here.
Get and start docker
Instructions here.
Get and set up git on your local machine.
Instructions here.
Make an AWS employee.
Instructions here.
Make an aws admin employee.
instructions here.
Install aws cli v2.
https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html
Let's say you're not the root user of this aws employee. Then the next thing you'd want to do is ask the root user on the employee (me, in this case) to be added to the IAM Users groups 'administrators'. Then the root user would get back to you with the console sign in link and/or an aws_access_key_id/aws_secret_access_key.
$ cd ~/.aws && ls
`$ touch config && open config` if config doesn't exist. Otherwise, `$ open config`
[default]
region = us-east-2
output = json
(Again, these instructions are specific to this project. If you're using your own project, be careful about the region, both here, in any terminal commands, files to be used in terminal commands, and in the aws web console.)
Save and close.
`$ touch credentials && open credentials` if credentials doesn't exist. Otherwise, `$ open credentials`
[default]
aws_access_key_id = whatever access key id you were given or downloaded or whatever
aws_secret_access_key = whatever secret access key you were given or downloaded or whatever
Save and close.
Make an ecr.
$ rm output.json
$ aws ecr create-repository --repository-name springboot-gradle-docker-aws --region us-east-2 >> output.json
{
"repository": {
"repositoryArn": "arn:aws:ecr:us-east-2:761280559302:repository/springboot-gradle-docker-aws",
"registryId": "76
没有合适的资源?快使用搜索试试~ 我知道了~
springboot-gradle-docker-aws:放回配置参考
共18个文件
java:7个
gradle:2个
gitignore:1个
需积分: 9 0 下载量 10 浏览量
2021-03-15
05:51:33
上传
评论
收藏 23KB ZIP 举报
温馨提示
警告:注释是为unix / linux编写的。 贡献第二次以上时间的说明: $ ./gradlew构建 $ docker build --build-arg DEPENDENCY = build / dependency -t springboot-gradle-docker-aws。 $ docker run -p 8080:8080 springboot-gradle-docker-aws:latest $ docker标签springboot-gradle-docker-aws:latest 761280559302.dkr.ecr.us-east-2.amazonaws.com/springboot-gradle-docker-aws:latest $ aws ecr get-login-password --region us-east-2 | docker登录-用户名A
资源详情
资源评论
资源推荐
收起资源包目录
springboot-gradle-docker-aws-main.zip (18个子文件)
springboot-gradle-docker-aws-main
gradlew 6KB
settings.gradle 214B
test_rest.py 2KB
src
test
java
com
company
springbootgradledockeraws
SpringbootGradleDockerAwsApplicationTests.java 248B
main
resources
static
index.html 2KB
java
com
company
springbootgradledockeraws
EmployeeNotFoundAdvice.java 671B
EmployeeController.java 2KB
SpringbootGradleDockerAwsApplication.java 368B
Employee.java 799B
EmployeeNotFoundException.java 249B
EmployeeRepository.java 189B
Dockerfile 132B
LICENSE 16KB
gradle
wrapper
gradle-wrapper.properties 202B
README.md 12KB
gradlew.bat 3KB
.gitignore 301B
build.gradle 906B
共 18 条
- 1
逸格草草
- 粉丝: 34
- 资源: 4592
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0