-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
27 lines (22 loc) · 893 Bytes
/
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
FROM ubuntu:latest
RUN apt-get update && apt-get install -y curl
RUN curl -OL "https://golang.org/dl/go1.21.0.linux-amd64.tar.gz"
RUN rm -rf /usr/local/go && tar -C /usr/local -xzf go1.21.0.linux-amd64.tar.gz
#RUN apt update && apt-get install -y golang-go sudo
ENV PATH="/usr/local/go/bin:${PATH}"
WORKDIR /app_dir
COPY ./ /app_dir/
RUN go build -o main ./cmd/main/main.go
RUN chmod +x main
CMD ["/app_dir/main"]
# Add the commands needed to put your compiled go binary in the container and
# run it when the container starts.
#
# See https://docs.docker.com/engine/reference/builder/ for a reference of all
# the commands you can use in this file.
#
# In order to use this file together with the docker-compose.yml file in the
# same directory, you need to ensure the image you build gets the name
# "kadlab", which you do by using the following command:
#
# $ docker build . -t kadlab