-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_py.Dockerfile
80 lines (55 loc) · 2.05 KB
/
_py.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# docker build -t devcontainer .
# docker run -n devcontainer -d
# or
# docker run -it $(docker build -q .)
FROM python:3.12
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
unzip \
git \
&& rm -rf /var/lib/apt/lists/*
# Install Terraform
RUN apt-get update && apt-get install -y gnupg software-properties-common
RUN wget -O- https://apt.releases.hashicorp.com/gpg | \
gpg --dearmor | \
tee /usr/share/keyrings/hashicorp-archive-keyring.gpg > /dev/null
RUN gpg --no-default-keyring \
--keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg \
--fingerprint
RUN echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
tee /etc/apt/sources.list.d/hashicorp.list
RUN apt update && apt-get install terraform
# Non-root user
# ARG USER_UID=1000
# ARG USER_GID=$USER_UID
# RUN groupadd --gid $USER_GID devuser && \
# useradd --uid $USER_UID --gid $USER_GID -m devuser
# Switch to the devuser
# USER devuser
# Install node.js
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs
# Install commitlint
RUN npm install -g commitlint @commitlint/cli @commitlint/config-conventional
# Setup git hooks
RUN git config --global core.hooksPath git-config
COPY git-config/ /home/git-config/
# Change owner
RUN chmod -R +x /home/git-config
# USER devuser
WORKDIR /workspace
# Install python dependencies if needed
# RUN pip install ...
CMD ["/bin/bash"]
# # Copy your hooks into the container
# COPY git-config /home/vscode/git-config
# # # Set permissions to make the hooks executable
# # RUN chmod -R +x /home/vscode/git-config/hooks
# # # Configure Git to use your custom hooks directory
# # RUN git config --global core.hooksPath /home/vscode/git-config/hooks
# WORKDIR /workspaces/devcontainer
# RUN chmod +x /home/vscode/git-config/scripts/git-setup.sh
# ENTRYPOINT ["/home/vscode/git-config/scripts/git-setup.sh"]
# keep docker running
ENTRYPOINT [ "tail", "-f", "/dev/null" ]