Skip to content

Commit

Permalink
Fix image (#3)
Browse files Browse the repository at this point in the history
* Updated docker image file
* rename lint
  • Loading branch information
makwanji authored Feb 21, 2023
1 parent 76089fd commit a1d5949
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: CI
pull_request:
jobs:
lint:
name: Lint
name: lint
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: release
on:
'on':
push:
branches:
- staging
Expand Down
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#Create MySQL Image for CICDPlay Tutorial Application
FROM mysql
# Derived from official mysql image (our base image)
FROM mysql:8.0.32-debian

ENV MYSQL_ROOT_PASSWORD cicdplaypassword
ADD cplay.sql /docker-entrypoint-initdb.d
# Add a database
ENV MYSQL_DATABASE company

EXPOSE 3306
# Add the content of the sql-scripts/ directory to your image
# All scripts in docker-entrypoint-initdb.d/ are automatically
# executed during container startup
COPY ./sql-scripts/ /docker-entrypoint-initdb.d/
21 changes: 20 additions & 1 deletion scripts/build-docker.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
#!/bin/bash

docker build -t cplaymysql:0.1 .
# Docker build image
docker build -t cicd-app1-db .

# Docker List images
docker images | grep cicd-app1-db

# Docker Tag images
docker tag cicd-app1-db:latest makwanji/cicd-app1-db:0.0.2
docker tag cicd-app1-db:latest makwanji/cicd-app1-db:latest

# Docker Push images
docker push makwanji/cicd-app1-db:0.0.2
docker push makwanji/cicd-app1-db:latest

# Docker list images
docker images | grep cicd-app1-db

# Docker build container from image
docker run -d --name cicd-app1-db makwanji/cicd-app1-db:latest
docker run -d -p 3306:3306 --name cicd-app1-db -e MYSQL_ROOT_PASSWORD=supersecret makwanji/cicd-app1-db:latest
File renamed without changes.
6 changes: 6 additions & 0 deletions sql-scripts/createtable.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE TABLE employees (
first_name varchar(25),
last_name varchar(25),
department varchar(15),
email varchar(50)
);
2 changes: 2 additions & 0 deletions sql-scripts/insertdata.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INSERT INTO employees (first_name, last_name, department, email)
VALUES ('Lorenz', 'Vanthillo', 'IT', 'lvthillo@mail.com');

0 comments on commit a1d5949

Please sign in to comment.