Edit ASP.NET Core website in Docker container on Windows and run on Ubuntu VPN - linux

I want to create a ASP.NET Core 2.0 website in a docker container and host it on a Linux VPS docker system. I tried creating an ASP.NET Core 2.0 project in Visual Studio, and then publishing it to docker hub. Everything works great, until I want to run that docker image on my Linux environment. I then get an error saying that this image is created for windows or something equivalent. I know I need to create the asp.net project in the Linux environment, then start coding (obviously), but I want to do the coding in for example Visual Studio on my PC, not via PICO or some other ssh-connected editor.
Summarized:
- I wish to run ASP.NET Core 2.0 website on Linux Docker VPS environment.
- I (think I) need to create the project in the Linux environment (I run Windows locally).
- Wish to edit the code in the docker container locally on my Windows environment.
Anyone know how I can achieve this?

Before creating ASP.NET Core 2 website on your windows operating system, right click on the Docker icon in system tray and then click Switch to Linux containers. Once switched to Linux containers, create ASP.NET Core website that you can host on Linux.

Related

Deploy .NET Core app to Linux giving me Site Cannot be Reached

Created a default .NET Core Web Application with Angular (literally created through Visual Studio 2019 and then published through Visual Studio 2019 with the Linux x64 profile). I copied the entire publish directory to a directory on my linux machine and ran the application. The application starts and says browse to http://localhost:5000. Well this linux machine only has shell access. So from my Windows machine (which can access other web applications on this machine from a different port) I open up the website (assume name of linux server is called 'linuxsvr') http://linuxsvr:5000 in Chrome Browser and I get this site cannot be reached.
I deployed using Self Contained Deployment so I'm not reliant on .NET Core being on the Linux machine. I'm apparently missing something. What is the correct way to deploy to a Linux Machine (specifically Ubuntu Server 14.04) with Self Contained Deployment?

Is it possible to run Docker CE in an azure VM?

If so, what vm image can I use?
This is purely for development purposes, and to simply run dev workloads on an azure VM that I can spin up and down as needed.
Docker CE for Windows says "Docker for Windows requires Windows 10 Pro or Enterprise version 10586, or Windows server 2016 RTM to run"
I just need a reasonable substitute than running locally since I am running windows 10 HOME on my laptop and would like to run Docker CE somewhere that actually works 100% of the time.
I tried the [Windows Server 2016 Datacenter with Containers] image that #win mentioned below, but it has enterrpise edition already installed out of the box, not CE
You need to use Windows Server 2016 Datacenter with Containers.

Visual C++ for Linux Development + Docker

I would like to develop a Linux C++ app by building and debugging in a Docker container. I intend to use Visual C++ for Linux Development to remote debug into the container. However this Visual Studio extension was originally intended for use with a Linux VM, Linux development and Docker are new to me, and I'm a little stuck on the basics of setting it up.
I have created an ubuntu:14.04 docker container and I have installed the Visual C++ for Linux dependencies in the container, namely openssh-server, g++, gdb and gdbserver. I have committed the container, creating an image to work with. I think I now need to run the container opening up a port so that I can connect to the container from Visual Studio.
How is this done? Does the container need to be further set up so that there is some kind of handler to handle communication on the port which is going to be opened? For instance does Bash need to be assigned to handle communication over the port? Or does one of the dependencies, perhaps openssh-server, need to be assigned to handle communication over the port? Or was something set up when I installed the dependencies? If so on which port?
In the Visual C++ for Linux Development instructions it shows that credentials such as Host name, Port, User name, Authentication type, and Password can be provided when connecting to a VM. Naturally Port will be required but will the others be required? If so do these credentials need to be set in the Ubuntu container or discovered somehow? If so how?
you can use this docker image ducatel/visual-studio-linux-build-box with a VM (like in the readme) or with docker for windows

Can my Azure Mobile Service run locally?

I am new to Azure. I am following this tutorial in setting up my .Net server for azure and ios client.
http://azure.microsoft.com/en-us/documentation/articles/mobile-services-dotnet-backend-ios-get-started/
I am testing my ios client on simulator. Can I run my .NET server on my location machine with put publish it to azure? If yes, how can I figure my client to talks to this location machine?
And in the tutorial, it creates a Database Table. If I run it locally, do I need to setup my location DB server?
Not on a mac (which you need for iOS development). With the .NET backend you can run the service locally on a Windows machine, but it will be running off of localhost.
For iOS development, you have two choices. If you use the JavaScript / node.js backend, where all of your development can be done in the Mac (you can configure the service via Git locally or directly in the portal). If you use the .NET backend (the link you mentioned), then you need the Mac for the client-side development, and a PC (or Windows running in the Mac on an emulator such as parallels) to develop the server (you need Visual Studio for that).
And regarding your question about the table, when you run it locally, it will use Entity Framework Code First (by default), so you don't need to create the table in your (local) database - it will create it automatically for you.

Autorun desktop app and check if it is running from a Windows 8 App

I´m developing a Windows 8 App, and it needs a desktop app running on background to work properly.
So i have two questions:
1.- The OS is a Windows 8.1 Industry Embedded. I need to autorun the desktop app and my Windows 8 app at startup.
Here explains how to do so with a Windows 8 App, but not with a desktop app, so i´m using this other solution to add the application to the Windows Startup folder, but i´m not sure if this is the best way.
2.- Then, when my app starts, i should check if the other app is running or not to work in one way or another. How can i check that? I´m developing with HTML and Javascript.
Thanks!
Yes that is the 'proper' solution to starting a desktop app on startup. Otherwise you can look at creating a windows service that manages the app lifecycle.
By design, winRT apps are not supposed to talk to desktop applications, but if you are sideloading the winRT app (i.e., not through the Windows Store), you could run a local server with your desktop app, and then enable local loopback with localhost in your winRT app and communicate that way.

Resources