-
Notifications
You must be signed in to change notification settings - Fork 1
/
funcMakeDefaultDockerfileForMeWithInstallExtras.go
62 lines (61 loc) · 2.61 KB
/
funcMakeDefaultDockerfileForMeWithInstallExtras.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package iotmakerdockerbuilder
// MakeDefaultDockerfileForMeWithInstallExtras
//
// Similar:
//
// MakeDefaultDockerfileForMe(), MakeDefaultDockerfileForMeWithInstallExtras()
//
// English:
//
// Automatically mount the Dockerfile-iotmaker inside the target folder.
//
// Caution:
//
// * The Dockerfile-iotmaker may be overwritten
//
// Rules:
//
// * For Golang projects, the go.mod file is mandatory;
// * The main.go file containing the main package must be at the root folder.
//
// Note:
//
// * If there are ports exposed in the configurations, they will be defined automatically and the
// same goes for volumes, where files shared between the host and the container will expose the
// folder containing the file inside the container as volume;
// * If you need a dockerfile made for another programming language, see the DockerfileAuto
// interface and the SetDockerfileBuilder() function;
// * If the image cache is enabled and image cahe is not found, the
// MakeDefaultDockerfileForMeWithInstallExtras() function will be used. It will download git,
// open-ssh and other tools necessary for the first part of the build in two steps;
// * The tools downloaded in the first step of the build and the ssh and git credentials will be
// discarded, only the binary generated by Golang will be transferred to the second image.
//
// Português:
//
// Monta o arquivo Dockerfile-iotmaker dentro da pasta alvo de forma automática.
//
// Cuidado:
//
// * O arquivo Dockerfile-iotmaker pode ser sobrescrito.
//
// Regras:
//
// * Para projetos Golang, o arquivo go.mod é obrigatório;
// * O arquivo main.go contendo o package main deve está na raiz do diretório.
//
// Nota:
//
// * Caso haja portas expostas ou volumes nas configurações, as mesmas serão definidas
// automaticamente, o mesmo serve para arquivos compartilhados entre o host e o container;
// * Caso necessite de um dockerfile feito para outra linguagem de programação, veja a interface
// DockerfileAuto e a função SetDockerfileBuilder();
// * Caso a imagem cache esteja habilitada e não seja encontrada, será usada a função
// MakeDefaultDockerfileForMeWithInstallExtras(), que baixará git, open-ssh e outras ferramentas
// necessárias para a primeira parte do build em duas etapas;
// * As ferramentas baixadas na primeira etapa do build e as credenciais ssh e git serão descartadas
// e apenas o binário gerado pelo Golang será transferido para a segunda imagem.
func (e *ContainerBuilder) MakeDefaultDockerfileForMeWithInstallExtras() {
e.makeDefaultDockerfile = true
e.imageInstallExtras = true
}