File tree Expand file tree Collapse file tree 4 files changed +118
-0
lines changed
Expand file tree Collapse file tree 4 files changed +118
-0
lines changed Original file line number Diff line number Diff line change 1+ ARG VARIANT=ubuntu-24.04
2+ FROM mcr.microsoft.com/vscode/devcontainers/base:${VARIANT}
3+
4+
5+ ENV TZ=UTC
6+ ENV DEBIAN_FRONTEND=noninteractive
7+ ENV DEVCONTAINER=true
8+
9+ RUN apt-get update
10+ RUN apt-get -y upgrade
11+
12+ RUN apt-get install -y --no-install-recommends \
13+ ca-certificates \
14+ curl \
15+ git \
16+ make \
17+ build-essential \
18+ libssl-dev \
19+ zlib1g-dev \
20+ libbz2-dev \
21+ libreadline-dev \
22+ libsqlite3-dev \
23+ wget \
24+ llvm \
25+ libncurses5-dev \
26+ libncursesw5-dev \
27+ xz-utils \
28+ tk-dev \
29+ libffi-dev \
30+ liblzma-dev
31+
32+ # Install Pyenv
33+ RUN curl https://pyenv.run | bash
34+ RUN echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
35+ RUN echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
36+ RUN echo 'eval "$(pyenv init -)"' >> ~/.bashrc
37+
38+ RUN /root/.pyenv/bin/pyenv install 3.12
39+ RUN /root/.pyenv/bin/pyenv global 3.12
40+ RUN apt-get install -y --no-install-recommends postgresql postgresql-contrib libpq-dev
41+ RUN ls /root/.pyenv/bin
42+ RUN /root/.pyenv/shims/python -m pip install --upgrade pip
43+ RUN /root/.pyenv/shims/python -m pip install psycopg2
44+
45+
46+ # __DEVCONTAINER_SNIPPET_INSERT__ (control where snippets get inserted using the devcontainer CLI)
47+
48+
49+ # Switch back to dialog for any ad-hoc use of apt-get
50+ ENV DEBIAN_FRONTEND=dialog
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " devcontainers-ci" ,
3+ "build" : {
4+ "dockerfile" : " ./Dockerfile" ,
5+ "context" : " ." ,
6+ // "cacheFrom": "ghcr.io/bascodes/prebuild-devcontainer-gha:cache"
7+ },
8+ "remoteUser" : " root" ,
9+ "features" : {
10+ "ghcr.io/devcontainers/features/github-cli:1" : " latest"
11+ }
12+ }
Original file line number Diff line number Diff line change 1+ name : Pre-build Devcontainer
2+
3+ on :
4+ workflow_dispatch :
5+ push :
6+ branches :
7+ - main
8+
9+ jobs :
10+ build_devcontainer :
11+ runs-on : ubuntu-24.04
12+ steps :
13+ - name : Checkout code
14+ uses : actions/checkout@v4
15+
16+ - name : Set up QEMU
17+ uses : docker/setup-qemu-action@v3
18+
19+ - name : Set up Docker Buildx
20+ uses : docker/setup-buildx-action@v3
21+ with :
22+ version : v0.16.1
23+ platforms : linux/amd64,linux/arm64
24+ install : true
25+ use : true
26+
27+ - name : Login to GitHub Container Registry
28+ uses : docker/login-action@v3
29+ with :
30+ registry : ghcr.io
31+ username : ${{ github.repository_owner }}
32+ password : ${{ secrets.GITHUB_TOKEN }}
33+
34+ - name : Pre-build dev container image
35+ uses : devcontainers/ci@v0.3
36+ with :
37+ imageName : ghcr.io/bascodes/prebuild-devcontainer-gha
38+ cacheTo : type=registry,ref=ghcr.io/bascodes/prebuild-devcontainer-gha:cache
39+ runCmd : sleep 1
40+ push : always
41+ platform : linux/amd64,linux/arm64
Original file line number Diff line number Diff line change 1+ def is_python_3_12 ():
2+ try :
3+ s = f"{ f"{ f"{ f"{ f"{ f"{ 1 + 1 } " } " } " } " } " } "
4+ except :
5+ return False
6+ return True
7+
8+ def main ():
9+ if is_python_3_12 ():
10+ print ("Python 3.12" )
11+ else :
12+ print ("Not Python 3.12" )
13+
14+ if __name__ == "__main__" :
15+ main ()
You can’t perform that action at this time.
0 commit comments