Skip to content

Commit

Permalink
Adding password variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Hernandez committed Dec 12, 2023
0 parents commit 49e4224
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
on:
repository_dispatch:
types: ['build-code-image']

jobs:
build-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}

- name: Build
uses: docker/build-push-action@v4
id: built-image
with:
context: .
file: ./Dockerfile
push: true
tags: tiicrc/claasp-code:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM tiicrc/claasp-lib:latest
USER root
RUN curl -fsSL https://code-server.dev/install.sh | sh
COPY docker-entrypoint.sh /docker-entrypoint.sh
ENV SHELL=/bin/bash
ENTRYPOINT ["/docker-entrypoint.sh"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# test-code-image
4 changes: 4 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
useradd $JUPYTER_USER -m -s /bin/bash -u $JUPYTER_USER_UID
echo $JUPYTER_USER:$PASSWORD | chpasswd
runuser -l $JUPYTER_USER -c "PASSWORD=$PASSWORD code-server --host 0.0.0.0 --port 8085 --auth password"

0 comments on commit 49e4224

Please sign in to comment.