Skip to content

Commit 9ff0867

Browse files
committed
specify Ubuntu 22.04, move git config to configure-git.sh and update readme
1 parent 2682972 commit 9ff0867

File tree

5 files changed

+108
-44
lines changed

5 files changed

+108
-44
lines changed

.devcontainer/configure-git.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
# Enable echoing of commands
3+
set -x
4+
5+
# Configure Git
6+
echo "##### Configure Git"
7+
echo "Configure Git to main"
8+
git config --global init.defaultBranch main
9+
echo "Configure Git user.name and email"
10+
git config --global user.name "Bill.Raymond"
11+
git config --global user.email [email protected]
12+
echo "#### Done configuring Git"

.devcontainer/devcontainer.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
3+
{
4+
"name": "Existing Dockerfile",
5+
"build": {
6+
// Sets the run context to one level up instead of the .devcontainer folder.
7+
"context": "..",
8+
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
9+
"dockerfile": "../Dockerfile"
10+
},
11+
12+
// Features to add to the dev container. More info: https://containers.dev/features.
13+
// "features": {},
14+
15+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
16+
// "forwardPorts": [],
17+
18+
// Uncomment the next line to run commands after the container is created.
19+
"postCreateCommand": "sh ./.devcontainer/configure-git.sh",
20+
21+
// Configure tool-specific properties.
22+
"customizations": {
23+
"vscode": {
24+
"extensions": [
25+
"ms-vscode-remote.remote-containers",
26+
"ms-python.python",
27+
"donjayamanne.python-extension-pack",
28+
"ms-toolsai.jupyter"
29+
]
30+
}
31+
},
32+
33+
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
34+
// "remoteUser": "devcontainer"
35+
}

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for more information:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
# https://containers.dev/guide/dependabot
6+
7+
version: 2
8+
updates:
9+
- package-ecosystem: "devcontainers"
10+
directory: "/"
11+
schedule:
12+
interval: weekly

Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:latest
1+
FROM ubuntu:22.04
22

33
# These settings prevent a timezone prompt when Python installs
44
ENV TZ=US/Pacific \
@@ -12,7 +12,8 @@ RUN apt-get update
1212

1313
# Install pre-requisites for Python
1414
RUN apt-get install -y \
15-
software-properties-common
15+
software-properties-common \
16+
libhdf5-dev
1617

1718
# Install the latest 3.x version of Python available from apt
1819
# RUN apt-get install -y python3 python3-pip python3-ipykernel
@@ -36,8 +37,3 @@ RUN pip3 install tensorflow \
3637
tensorflow \
3738
statsmodels \
3839
stats
39-
40-
# Configure git
41-
RUN git config --global user.name "Bill.Raymond" &&\
42-
git config --global user.email [email protected] &&\
43-
git config --global init.defaultBranch main

README.md

Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,50 @@
11
# machine-learning-general-purpose
2-
The GitHub repo for a Dockerhub image that will be updated as new technology is required.
2+
This is my machine learning and general utility Python image
33

4-
If you are using a Microsoft Dev Container, you may want to add existing extensions. Note the `customizations:` section below:
4+
## To use the image from Dockerhub
5+
I do not manage versions of the dockerfile, so I suggest you perform the following steps:
56

6-
`.devcontainer/devcontainer.json`
7+
1. In your repo, add the following line:
78
```
8-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
9-
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
10-
{
11-
"name": "Existing Dockerfile",
12-
"build": {
13-
// Sets the run context to one level up instead of the .devcontainer folder.
14-
"context": "..",
15-
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
16-
"dockerfile": "../Dockerfile"
17-
},
18-
// Features to add to the dev container. More info: https://containers.dev/features.
19-
// "features": {},
20-
21-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
22-
// "forwardPorts": [],
23-
24-
// Uncomment the next line to run commands after the container is created.
25-
// "postCreateCommand": "cat /etc/os-release",
26-
27-
// Configure tool-specific properties.
28-
"customizations": {
29-
"vscode": {
30-
"extensions": [
31-
"ms-azuretools.vscode-docker",
32-
"ms-toolsai.jupyter",
33-
"ms-python.python"
34-
]
35-
}
36-
}
37-
38-
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
39-
// "remoteUser": "devcontainer"
40-
}
41-
```
9+
FROM billraymond/machine-learning-general-purpose:latest
10+
```
11+
2. Copy over the `./devcontainer` folder from this repo and modify the `configure-git.sh` file to use your user.email and user.name.
12+
3. Note that you can add, remove, or modify the VSC extensions in the `./devcontainer/devcontainer.json file`
13+
14+
## Customize this container
15+
If you want to customize the container, I recommend you download the code (ex zip file) so you can use the `./devcontainer` folder and tailor that to your needs as well.
16+
17+
While the requirements for this image may change over time, the devcontainer will include:
18+
19+
1. An LTS version of Ubuntu
20+
2. The latest version of Python 3 from the APT package manager
21+
3. Other items may include Git, Tensorflow, Git, h5py, SciKitLearn, and more
22+
4. Check out the Dockerfile contained in this repo for more details of what is or is not installed
23+
24+
## Example customization
25+
Here is an example Dockerfile for another repo I manage that adds more capabilities, like OpenAI's API, tabulate, pandoc, markdown, and more. Note that it pulls from the base DockerHub container and then adds more packages to it.
26+
27+
`Dockerfile`
28+
```
29+
FROM billraymond/machine-learning-general-purpose:latest
30+
31+
# Install pillow qr code and pillow for graphics manipulation
32+
RUN pip install --no-cache-dir qrcode[pil] && \
33+
pip install --no-cache-dir --upgrade pillow
34+
35+
# Install various tools in support of utilities
36+
RUN pip install --no-cache-dir python-pptx \
37+
openai \
38+
tabulate \
39+
pandoc \
40+
markdown2 \
41+
pdfkit \
42+
beautifulsoup4
43+
RUN apt-get update
44+
RUN apt-get install -y wkhtmltopdf
45+
46+
RUN rm -rf /var/lib/apt/lists/*
47+
```
48+
49+
## Feedback
50+
This is a genearl purpose solution for me, but if you have some ideas or recommendations, feel free to submit a pull request or open an issue.

0 commit comments

Comments
 (0)