-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
36 lines (23 loc) · 1.08 KB
/
Dockerfile
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
#build our docker image with name iqhater/get-youtube-thumbnail
#docker build -t iqhater/get-youtube-thumbnail .
#run our docker container afterwards remove himself
#docker run --rm -it iqhater/get-youtube-thumbnail:latest
#Docker Remove All <none> images (only run in bash terminal)
#docker rmi $(docker images -f "dangling=true" -q)
################################################################
#name of base image
FROM golang:1.14
#need to enable to run tests!
ENV CGO_ENABLED=1
#create a folder where our program will be located
RUN mkdir -p /go/src/github.com/iqhater/get-youtube-thumbnail
#set a working directory with a created folder
WORKDIR /go/src/github.com/iqhater/get-youtube-thumbnail
#Copy all files from source to the Docker's path in the image's filesystem
COPY . /go/src/github.com/iqhater/get-youtube-thumbnail
#run test with coverage and goes to test_data folder. Must be empty
CMD go test -race -v -cover ./...
# Compile the action
RUN go build -o /bin/get-youtube-thumbnail
# Specify the container's entrypoint as the action
ENTRYPOINT ["/bin/get-youtube-thumbnail"]