-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
45 lines (35 loc) · 1003 Bytes
/
Dockerfile.dev
File metadata and controls
45 lines (35 loc) · 1003 Bytes
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
# Development Dockerfile for CAM-OS Kernel
FROM golang:1.21-alpine AS development
# Install development tools
RUN apk add --no-cache \
git \
ca-certificates \
tzdata \
make \
curl \
bash \
protoc \
protobuf-dev
# Install Go development tools
RUN go install github.com/go-delve/delve/cmd/dlv@latest
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
RUN go install github.com/air-verse/air@latest
# Set working directory
WORKDIR /workspace
# Copy go mod files
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
# Create development user
RUN addgroup -g 1001 -S developer
RUN adduser -S developer -u 1001
# Change ownership of workspace
RUN chown -R developer:developer /workspace
RUN chown -R developer:developer /go
# Switch to development user
USER developer
# Expose ports
EXPOSE 8080 9090 2345
# Default command for development
CMD ["air", "-c", ".air.toml"]