-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgo.Dockerfile
More file actions
57 lines (45 loc) · 1.73 KB
/
go.Dockerfile
File metadata and controls
57 lines (45 loc) · 1.73 KB
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
# using the official ubuntu base image
FROM ubuntu:latest
ARG GO_VERSION
ENV GO_VERSION=1.24.5
# installing make, git, gcc
RUN apt-get update && apt-get install -y make git curl tar python3-pip
RUN apt-get update -y \
&& apt-get upgrade -y \
&& apt-get -y install build-essential \
zlib1g-dev \
libncurses5-dev \
libgdbm-dev \
libnss3-dev \
libssl-dev \
libreadline-dev \
libffi-dev \
libsqlite3-dev \
libbz2-dev \
wget
# Install Python
RUN cd /usr/src \
&& wget https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz \
&& tar -xzf Python-3.11.9.tgz \
&& cd Python-3.11.9 \
&& ./configure --enable-optimizations \
&& make altinstall
# Install Golang
RUN wget -P /tmp "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz"
RUN tar -C /usr/local -xzf "/tmp/go${GO_VERSION}.linux-amd64.tar.gz"
RUN rm "/tmp/go${GO_VERSION}.linux-amd64.tar.gz"
ENV GOPATH=/go
ENV PATH=$GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
RUN go install golang.org/x/tools/gopls@latest
# Download and extract CodeQL
# RUN curl -L https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.22.1/codeql-bundle-linux64.tar.gz | tar -xz -C /opt/ && \
# ln -s /opt/codeql /usr/local/bin/codeql
RUN curl -L https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.22.1/codeql-bundle-linux64.tar.gz | tar -xz -C /opt/
# Set PATH (optional if you're using the symlink)
ENV PATH="/opt/codeql:$PATH"
WORKDIR /app
COPY requirements.txt /app
RUN pip install -r requirements.txt --break-system-packages
# specifying the command to run when the container starts
CMD ["/bin/bash"]