简体   繁体   English

将 Go 1.6 Web 应用程序部署到 AWS Elastic Beanstalk?

[英]Deploying Go 1.6 web app to AWS Elastic Beanstalk?

I want to deploy my web app to elastic beanstalk but it appears to only support Go 1.4 rather than Go 1.6.我想将我的网络应用程序部署到弹性 beanstalk,但它似乎只支持 Go 1.4 而不是 Go 1.6。 Is there a way to get a custom image?有没有办法获得自定义图像?

The reason I want 1.6 is because it supports vendoring and my web app depends on 3rd party packages.我想要 1.6 的原因是因为它支持 vendoring 并且我的 Web 应用程序依赖于 3rd 方包。

The best choice would be to use docker .最好的选择是使用docker

Here are the steps to deploy your application to Elastic Beanstalk:以下是将应用程序部署到 Elastic Beanstalk 的步骤:

  1. Choose the Generic Docker platform when creating a new environment.创建新环境时选择Generic Docker平台。
  2. Put a file named Dockerfile in your project root with the following content:将一个名为Dockerfile的文件放在你的项目根目录中,内容如下:

FROM golang:1.6.2-onbuild
EXPOSE 80

  1. Add a canonical import path to your main.go .规范的导入路径添加到您的main.go For example, if your package name is my/package the first line of main.go should be package main // import "my/package"例如,如果你的包名是my/packagemain.go的第一行应该是package main // import "my/package"
  2. Make your application listen on port 80使您的应用程序侦听端口 80
  3. Deploy!部署!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM