{public dbset public class Tbuser { [databasegenerated (Databasegeneratedoption.none)] public int ID {get; set;} public string Nickname {get; set;} public string Email {get; set;} } public class Tbuserdatahandle:datacontext {public static int adduser (Tbuser user) {try {using (var context = new DataContext ()) {context. Database.ensurecreated (); Context. ADD (user); Context. SaveChanges ();
First, the environmentUbuntu 14.04Docker version 1.9Second, the preparatory work
Download Ubuntu image----Docker pull Ubuntu
New Apache directory mkdir/apache into Apache Cd/apache
New File Dockerfile Touch Dockerfile
Create a new index.html touch index.html in the Apache directory
VI index.html Input:
VI Dockerfile Input:From UbuntuMaintainer ZHONGRUN APT-GET-YQQ UpdateRUN apt-get-yqq Install
1, actual combat purposes
build an enterprise-private mirrored warehouse that meets push and pull mirroring from the development environment . When we use k8s to orchestrate and dispatch containers, the basic unit of the operation is mirroring, so we need to pull the mirror from the repository to the current working node. The use of a public Docker hub is perfectly suited to our needs and is very convenient, but the uploaded
Package a Docker image so that your friends can load and open a container and output hello and world to the specified file every second,
I. Two script codes
Dockerfile
1 FROM bash2 COPY . /usr/herui/3 WORKDIR /usr/herui/4 CMD [ "sh", "hello_world.sh" ]
Hello_world.sh
1 #!/bin/bash2 while true3 do4 echo 'hello world!' >> /usr/herui/hello_world.log5 sleep 16 done
Ii. package it into an
1. Install Ubuntu2. use Putty to log on to UbuntuWelcometoUbuntu14.04.1LTS (GNU/linux3.20.- 40-genericx86_64) * Documentation: https://help.ubuntu.com/SysteminformationasofWedDec3106:41
1. Install Ubuntu2. Use Putty to log on to UbuntuWelcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.small-40-generic x86_64)
* Documentation: https://help.ubuntu.com/
System information as of Wed Dec 31 06:41:16 UTC 2014
System load: 0.01 Processes: 228Usage of/: 6.0% of 28.80 GB Users logged in: 0Memory usage: 11% IP ad
Docker container run, generally cannot ssh, this container management brings trouble, below will explain how to create a docker image that supports SSH
Download the Ubuntu image from the dock hub firstCommand: Docker pull Ubuntu
Create a new Ssh_ubuntu directoryMkdir/s
Installation environment, CentOS Linux version 3.10.0-514.el7.x86_641. Find the latest MySQL imageDocker search MySQL2, download the latest mysql-server imageDocker pull Mysql/mysql-server:latest 3, after the download is complete, you can view the downloaded image Docker images 4, build container, the-e command to set the default password,--name can customize the name of the
When you create a mirror through dockerfile, it is generally based on the official image provided by the Docker Hub. The following describes how to create a personal private base image on a ubuntu16 system .1, install bootstrap tool Debootstrap$ sudo apt-get insall debootstrap-y2. Download ubuntuxenial (16.04) binaries using debootstrap3. Create a base
docker:/root# Docker PS CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f3cb864be528 192.168.32.150:5000/zjzc_centos6.5_templat E "Bash" about a minute ago up about a minute zjzc_test99 d25712059 702 192.168.32.150:5000/zjzc_centos6.5_m2 "bash" 7 minutes ago up 7 minutes Sick_wright 8302f2eb1c9e 192.168.32.150:50
List of files prepared on the host:
Dockerfile
#启动ssh和apache服务的角本
run.sh1 2 3 1 2 3
The above files are placed in the/root/apache_centos directory
Mkdir-p/root/apache_centos
Cd/root/apache_centos1 2 1 2
Base Image: An image of an open SSH service based on a mirrored CentOS
[Root@localhost apache_centos]# Docker images
REPOSITORY TAG
Recently began to use Docker, the common command to touch once, want to put the image of the build process on the Jenkins. The specific process will not say, very simple, only need a few commands on it.
An exception can be reported when pushing to a private registry:
Docker push registry.mydocker.com/demo/small:latest The
push refers to Repository [registry.mydoc
Install the Redis image with Docker in Ubuntu and share it with the Redis container
1. Install Ubuntu2. Use Putty to log on to UbuntuWelcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.small-40-generic x86_64)
* Documentation: https://help.ubuntu.com/
System information as of Wed Dec 31 06:41:16 UTC 2014
System load: 0.01 Processes: 228Usage of/: 6.0% of 28.80 GB Users logged in: 0Memory usage: 11% IP address for et
To remotely connect Docker containers using the SSH service based on CentOSEnvironment: Host CENTOS7, directly search Docker's CentOS image, download the latest version1, first according to Docker:yum Install-y Epel-releaseYum Install-y Docker2, start the Docker:systemctl start Docker.service3. Use PS to see if Docker is startedPS aux |grep Docker4. Download the
Summary: Sometimes we need to package a PHP project into a Docker image, which is described hereIdea: We PHP and Apache combine an image to implement PHP project Access, MySQL is a separate mirrorSteps:1. First of all, we test the local PHP project is not available, after all, put on the server after the test is not very convenient. We then import the PHP project
Create a docker image and initialize the jdk8 and tomcat environments.1. Create a Dockerfile:
Create a Dockerfile and download jdk and tomcat in the same directory as Dockerfile.
Dockerfile content:
1 FROM Ubuntu: 14.10 2 MAINTAINER linx 3 4 # ADD java and tomcat to the container 5 ADD jdk-8u31-linux-x64.tar.gz/usr/local/6 ADD apache-tomcat-8.0.20.tar.gz/usr/local/7 8 # configure java and tomcat Environmen
Label:SQLite has a very serious disadvantage is not to provide repair command. Cause death Hint Database disk image is malformed it has many possibilities, such as insufficient disk space, and sudden power-down during writing data. Official explanation of the cause: Http://www.sqlite.org/lockingv3.html#how_to_corruptSQLite my.sqlite3
sqlite>pragma Integrity_check;
Get tipsIn database main * * *
page 1518:b
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.