How to deploy a written golang project under docker?

ask for advice:
I have a local project in go language. Now I want to push the image to the online warehouse, and then pull from the online server to the production environment and run it.

my local directory is go- > src

        ->github/
        ->myapp/
        
        myapp github 
        myapp Dockerfile 
        
        
        ~~
Mar.13,2021

Thank you for the invitation

you can refer to the following steps

1. Solve the project dependency problem:

use tools such as govendor and dep to put project dependencies under the vendor package under the myapp project

2, Golang App package docker Image:

reference article Gin practice Serial 9 deploy Golang applications to Docker

3. Push image to online deployment

then you need to upload your packaged image to the image library before you can reach pull to the production environment
(package the local image-"upload remote image library -" pull the required image from the remote image library)

.
  • use Docker Hub
  • use other domestic providers
  • the company sets up a private one, and it's not difficult (the internal ones basically adopt this)
< hr >

the general idea is as above, follow the check and do, you can solve your problem

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e42033-4498a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e42033-4498a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?