Skip to content

Commit c3cfc53

Browse files
committed
Init
0 parents  commit c3cfc53

File tree

5 files changed

+191
-0
lines changed

5 files changed

+191
-0
lines changed

.dockerignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Include any files or directories that you don't want to be copied to your
2+
# container here (e.g., local build artifacts, temporary files, etc.).
3+
#
4+
# For more help, visit the .dockerignore file reference guide at
5+
# https://docs.docker.com/go/build-context-dockerignore/
6+
7+
**/.DS_Store
8+
**/__pycache__
9+
**/.venv
10+
**/.classpath
11+
**/.dockerignore
12+
**/.env
13+
**/.git
14+
**/.gitignore
15+
**/.project
16+
**/.settings
17+
**/.toolstarget
18+
**/.vs
19+
**/.vscode
20+
**/*.*proj.user
21+
**/*.dbmdl
22+
**/*.jfm
23+
**/bin
24+
**/charts
25+
**/docker-compose*
26+
**/compose.y*ml
27+
**/Dockerfile*
28+
**/node_modules
29+
**/npm-debug.log
30+
**/obj
31+
**/secrets.dev.yaml
32+
**/values.dev.yaml
33+
LICENSE
34+
README.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Publish texmacs-cd Container
2+
# copyed from https://github.com/actions/checkout/blob/main/.github/workflows/update-test-ubuntu-git.yml
3+
4+
on:
5+
# Use an on demand workflow trigger.
6+
# (Forked copies of actions/checkout won't have permission to update GHCR.io/actions,
7+
# so avoid trigger events that run automatically.)
8+
workflow_dispatch:
9+
inputs:
10+
publish:
11+
description: 'Publish to ghcr.io? (main branch only)'
12+
type: boolean
13+
required: true
14+
default: false
15+
16+
env:
17+
REGISTRY: ghcr.io
18+
IMAGE_NAME: texmacs/texmacs-2.1.4-cd
19+
20+
jobs:
21+
build-and-push-image:
22+
runs-on: ubuntu-latest
23+
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
24+
permissions:
25+
contents: read
26+
packages: write
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
32+
# Use `docker/login-action` to log in to GHCR.io.
33+
# Once published, the packages are scoped to the account defined here.
34+
- name: Log in to the ghcr.io container registry
35+
uses: docker/login-action@v3.3.0
36+
with:
37+
registry: ${{ env.REGISTRY }}
38+
username: ${{ github.actor }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Format Timestamp
42+
id: timestamp
43+
# Use `date` with a custom format to achieve the key=value format GITHUB_OUTPUT expects.
44+
run: date -u "+now=%Y%m%d.%H%M%S.%3NZ" >> "$GITHUB_OUTPUT"
45+
46+
- name: Issue Image Publish Warning
47+
if: ${{ inputs.publish && github.ref_name != 'main' }}
48+
run: echo "::warning::test-ubuntu-git images can only be published from the actions/checkout 'main' branch. Workflow will continue with push/publish disabled."
49+
50+
# Use `docker/build-push-action` to build (and optionally publish) the image.
51+
- name: Build Docker Image (with optional Push)
52+
uses: docker/build-push-action@v6.5.0
53+
with:
54+
context: .
55+
file: Dockerfile
56+
# For now, attempts to push to ghcr.io must target the `main` branch.
57+
# In the future, consider also allowing attempts from `releases/*` branches.
58+
push: ${{ inputs.publish && github.ref_name == 'main' }}
59+
tags: |
60+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}.${{ steps.timestamp.outputs.now }}

Dockerfile

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM debian:bookworm
2+
#ubuntu:22.04
3+
#MAINTAINER Massimiliano Gubinelli <m.gubinelli@gmail.com>
4+
5+
LABEL org.opencontainers.image.title="Debian Bookword + git + TeXmacs"
6+
LABEL org.opencontainers.image.description="Debian image with git + TeXmacs pre-installed. Intended primarily for CD workflows."
7+
#LABEL org.opencontainers.image.documentation="https://github.com/actions/checkout/tree/main/images/test-ubuntu-git.md"
8+
LABEL org.opencontainers.image.licenses=MIT
9+
10+
ENV DEBIAN_FRONTEND=noninteractive
11+
12+
RUN apt-get update \
13+
&& apt-get install -y build-essential wget git libfontconfig1
14+
# && rm -rf /var/lib/apt/lists/*
15+
16+
17+
RUN apt-get install -y --fix-missing \
18+
&& apt-get install -f -y
19+
20+
# Install TeXmacs 2.1.4 from package
21+
RUN wget http://www.texmacs.org/Download/ftp/tmftp/Linux/Debian_12/TeXmacs-2.1.4.amd64.deb -O /tmp/texmacs.deb \
22+
&& DEBIAN_FRONTEND=noninteractive apt install -y /tmp/texmacs.deb \
23+
&& rm -r /tmp/texmacs.deb
24+
25+
WORKDIR /usr/local/app
26+
RUN useradd app
27+
USER app
28+

README.Docker.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
### Building and running your application
2+
3+
When you're ready, start your application by running:
4+
`docker compose up --build`.
5+
6+
### Deploying your application to the cloud
7+
8+
First, build your image, e.g.: `docker build -t myapp .`.
9+
If your cloud uses a different CPU architecture than your development
10+
machine (e.g., you are on a Mac M1 and your cloud provider is amd64),
11+
you'll want to build the image for that platform, e.g.:
12+
`docker build --platform=linux/amd64 -t myapp .`.
13+
14+
Then, push it to your registry, e.g. `docker push myregistry.com/myapp`.
15+
16+
Consult Docker's [getting started](https://docs.docker.com/go/get-started-sharing/)
17+
docs for more detail on building and pushing.

compose.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Comments are provided throughout this file to help you get started.
2+
# If you need more help, visit the Docker Compose reference guide at
3+
# https://docs.docker.com/go/compose-spec-reference/
4+
5+
# Here the instructions define your application as a service called "app".
6+
# This service is built from the Dockerfile in the current directory.
7+
# You can add other services your application may depend on here, such as a
8+
# database or a cache. For examples, see the Awesome Compose repository:
9+
# https://github.com/docker/awesome-compose
10+
services:
11+
app:
12+
build:
13+
context: .
14+
target: final
15+
# If your application exposes a port, uncomment the following lines and change
16+
# the port numbers as needed. The first number is the host port and the second
17+
# is the port inside the container.
18+
# ports:
19+
# - 8080:8080
20+
21+
# The commented out section below is an example of how to define a PostgreSQL
22+
# database that your application can use. `depends_on` tells Docker Compose to
23+
# start the database before your application. The `db-data` volume persists the
24+
# database data between container restarts. The `db-password` secret is used
25+
# to set the database password. You must create `db/password.txt` and add
26+
# a password of your choosing to it before running `docker compose up`.
27+
# depends_on:
28+
# db:
29+
# condition: service_healthy
30+
# db:
31+
# image: postgres
32+
# restart: always
33+
# user: postgres
34+
# secrets:
35+
# - db-password
36+
# volumes:
37+
# - db-data:/var/lib/postgresql/data
38+
# environment:
39+
# - POSTGRES_DB=example
40+
# - POSTGRES_PASSWORD_FILE=/run/secrets/db-password
41+
# expose:
42+
# - 5432
43+
# healthcheck:
44+
# test: [ "CMD", "pg_isready" ]
45+
# interval: 10s
46+
# timeout: 5s
47+
# retries: 5
48+
# volumes:
49+
# db-data:
50+
# secrets:
51+
# db-password:
52+
# file: db/password.txt

0 commit comments

Comments
 (0)