Skip to content

Commit 43ba464

Browse files
committed
[wip] full docker
1 parent 2c0a177 commit 43ba464

3 files changed

Lines changed: 53 additions & 3 deletions

File tree

.github/workflows/envbase.yaml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ on:
1111
env:
1212
REGISTRY: ghcr.io
1313
IMAGE_NAME: xs-mlvp/envbase
14-
IMAGE_TAG: ${{ github.sha.substring(0, 7) }}
14+
FULL_IMAGE_NAME: xs-mlvp/envfull
15+
IMAGE_TAG: ${{ github.sha }}
1516

1617
jobs:
17-
build-and-push:
18+
build-and-push-base:
1819
runs-on: ubuntu-latest
1920
permissions:
2021
contents: read
@@ -46,3 +47,37 @@ jobs:
4647
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
4748
cache-from: type=local,src=/tmp/.buildx-cache
4849
cache-to: type=local,dest=/tmp/.buildx-cache
50+
51+
build-and-push-full:
52+
runs-on: ubuntu-latest
53+
needs: build-and-push-base
54+
permissions:
55+
contents: read
56+
packages: write
57+
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v4
61+
62+
- name: Set up Docker Buildx
63+
uses: docker/setup-buildx-action@v2
64+
65+
- name: Log in to GitHub Container Registry
66+
uses: docker/login-action@v2
67+
with:
68+
registry: ${{ env.REGISTRY }}
69+
username: ${{ github.actor }}
70+
password: ${{ secrets.GITHUB_TOKEN }}
71+
72+
- name: Build and push Docker image
73+
uses: docker/build-push-action@v4
74+
with:
75+
context: .
76+
file: ./docker/Dockerfile.full
77+
platforms: linux/amd64,linux/arm64
78+
push: true
79+
tags: |
80+
${{ env.REGISTRY }}/${{ env.FULL_IMAGE_NAME }}:${{ env.IMAGE_TAG }}
81+
${{ env.REGISTRY }}/${{ env.FULL_IMAGE_NAME }}:latest
82+
cache-from: type=local,src=/tmp/.buildx-cache
83+
cache-to: type=local,dest=/tmp/.buildx-cache

docker/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ RUN mkdir /workspace && \
110110
RUN useradd -m -s /bin/bash user && \
111111
echo "user:user" | chpasswd && \
112112
adduser user sudo && \
113-
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
113+
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
114+
chown user:user -R /workspace && \
115+
chmod 755 /workspace
114116

115117
# Switch to the new user
116118
USER user

docker/Dockerfile.full

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM ghcr.io/xs-mlvp/envbase:latest
2+
3+
USER user
4+
WORKDIR /workspace
5+
6+
RUN mkdir tutorial && \
7+
cd tutorial && \
8+
pip3 install pytoffee && \
9+
git clone https://github.com/SFangYy/tutorial_code.git --depth=1
10+
11+
RUN git clone https://github.com/OpenXiangShan/XSPdb.git --depth=1 && \
12+
cd XSPdb && \
13+
pip3 install -r requirements.txt

0 commit comments

Comments
 (0)