SkyWalking Go supports building user applications using Docker as the base container image.
Using the SkyWalking Go provided image as the base image, perform file copying and other operations in the Dockerfile.
# import the skywalking go base image FROM apache/skywalking-go:<version>-go<go version> # Copy application code COPY /path/to/project /path/to/project # Inject the agent into the project or get dependencies by application self RUN skywalking-go-agent -inject /path/to/project # Building the project including the agent RUN go build -toolexec="skywalking-go-agent" -a /path/to/project # More operations ...
In the above code, we have performed the following actions:
/usr/local/bin
directory with the name skywalking-go-agent.